Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed INC/DEC (for lazy flags) #434

Merged
merged 1 commit into from
Aug 4, 2021
Merged

Fixed INC/DEC (for lazy flags) #434

merged 1 commit into from
Aug 4, 2021

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