logicalshift.h
来自「简单的虚拟机」· C头文件 代码 · 共 36 行
H
36 行
#define handle_logishift8(opstr,op,imm) \{ \ word __dest = get_op_val(op); \ __asm__("push %%edx\n\t" \ "popfl\n\t" \ #opstr" %%cl,%%al\n\t" \ "pushfl\n\t" \ "pop %%edx\n\t" \ :"=a"(__dest),"=d"(cpu.flags) \ :"a"(__dest),"d"(cpu.flags),"c"(imm)); \ set_op_val(op,__dest); \}#define handle_logishift16(opstr,op,imm) \{ \ word __dest = get_op_val(op); \ __asm__("push %%edx\n\t" \ "popfl\n\t" \ #opstr" %%cl,%%ax\n\t" \ "pushfl\n\t" \ "pop %%edx\n\t" \ :"=a"(__dest),"=d"(cpu.flags) \ :"a"(__dest),"d"(cpu.flags),"c"(imm)); \ set_op_val(op,__dest); \}#define handle_logicalshift(opstr,op,imm,wFlag) \ if(wFlag) \ { \ handle_logishift16(opstr,op,imm) \ } \ else \ { \ handle_logishift8(opstr,op,imm) \ }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?