Skip to content

Fixed INC/DEC (for lazy flags)#434

Merged
ptitSeb merged 1 commit intoptitSeb:masterfrom
piz-ewing:master
Aug 4, 2021
Merged

Fixed INC/DEC (for lazy flags)#434
ptitSeb merged 1 commit intoptitSeb:masterfrom
piz-ewing:master

Conversation

@piz-ewing
Copy link
Contributor

// gcc box86_test.c -o box86_test
#include <stdio.h>

__attribute__((naked)) int foo()
{
  __asm(
    "movl $0xFFFFFFFF, %eax\n\t"
    "addl $1, %eax\n\t"
    "incl %eax\n\t"
    "pushf\n\t"
    "pop  %eax\n\t"
    "ret\n\n"
    );
}

int main()
{
  printf("eflags: 0x%08x\n", foo());
  return 0;
}

asm

test

dec
inc

@ptitSeb ptitSeb merged commit 0261274 into ptitSeb:master Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants