lahf.c

来自「The Valgrind distribution has multiple t」· C语言 代码 · 共 34 行

C
34
字号
#include <stdio.h>extern int foo_1 ( void );asm("\n""foo_1:\n""\tpushl $0\n""\tpopfl\n""\tmovl $0xFFFFFFFF, %eax\n""\tmovl $0x12345678, %edx\n""\tsubl %eax, %edx\n""\tlahf\n""\tret\n");extern int foo_0 ( void );asm("\n""foo_0:\n""\tpushl $0\n""\tpopfl\n""\tmovl $0x0, %eax\n""\tmovl $0x12345678, %edx\n""\tsubl %eax, %edx\n""\tlahf\n""\tret\n");int main ( void ){  printf("0x%x\n", foo_0());  printf("0x%x\n", foo_1());  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?