【发布时间】:2014-05-09 09:44:17
【问题描述】:
//comment or description about function of this assembly code
MOV A,#15 /* comment about this here */
MOV B,#23 /*comment about this here */
//add a comment here about function of next block of code
Loop CMP A,B /*comment here */
JAE LpDone /*comment here */
ADD A,#101 /*comment here */
JMP Loop /*comment here */
LpDone NOP /*comment here */
谁能解释一下这个程序的步骤和它们的作用? 我尝试通过跨步功能使用 Visual Studio 调试模式查看它,但不太了解它们的作用?
非常感谢您的帮助,
【问题讨论】:
-
不要链接到你的代码截图。将代码作为文本包含在您的问题中(格式正确;例如,在每行的开头放置 4 个空格)。
-
这适用于哪种 CPU 架构?助记符看起来像是 x86 的,但操作数不是。
-
抱歉之前添加了图片链接,我对 Stack 论坛还很陌生。是的,这是 Intel x8086 架构。
-
好吧,
CMP A,B不是有效的 x86 指令,因为没有任何形式的CMP可以接受两个内存操作数。也许A和B应该是EAX和EBX,但问题中没有说。 -
再看我的讲义,这是里面唯一提到的一段代码,虽然没有提到那里的指令集,只是显示了汇编代码。假设它们是 EAX 和 EBX 寄存器,您是否可以逐步解释它是如何工作的?
标签: visual-studio assembly x86