简体   繁体   English

如何在 8 位模式下进行 x86 算术并更新标志?

[英]How can x86 arithmetic in 8 bit mode and update the flags?

I want simulate 8051 using the x86 instruction.我想使用 x86 指令模拟 8051。 In 32 bits mode, I have to rotate left to get the carry flag.在 32 位模式下,我必须向左旋转才能获得进位标志。 it is more steps to get the overflow flag.获取溢出标志的步骤更多。 Do you know how to AL, BL, CL, DL, to do arithmetic operation and update the flags.你知道如何对 AL、BL、CL、DL 进行算术运算和更新标志吗?

Thank you very much.非常感谢。 "ADD AL, CL" work. “添加 AL,CL”工作。 I am not quite familiar with x86 ISA, because of 8bit 16bit 32bit 64bit and its compatibility.我对 x86 ISA 不太熟悉,因为 8bit 16bit 32bit 64bit 和它的兼容性。 I try ADD instruction to see the flags changing all day long and could not get the satisfy answer until I see your post.我尝试添加指令以查看标志整天都在变化,并且在看到您的帖子之前无法得到满意的答案。 X86 machine could not execute 8051 code. X86 机器无法执行 8051 代码。 8051 simulator is perform by my program including fetch-decode-execute. 8051 模拟器由我的程序执行,包括 fetch-decode-execute。 If I could use 8-bit x86 ISA, then the execution part of 8051 simulator could use native machine code.如果我可以使用 8 位 x86 ISA,那么 8051 模拟器的执行部分可以使用本机机器码。 In fact, I am planing to simulate 8051 ALU by using verilog if x86 ISA could not support 8 bit operation.事实上,如果 x86 ISA 不支持 8 位操作,我计划使用 verilog 模拟 8051 ALU。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM