jmp 循环后程序计数器的值(汇编)

Value of Program Counter after jmp loop (Assembly)

我在作业中有这个问题(下面引用),我不明白。我尝试使用谷歌搜索有关无条件分支、goto、跳转循环、汇编语言的更多信息,但一无所获。

我们将不胜感激任何类型的帮助。我对计算机硬件还是个新手。我知道答案不应该太复杂。谢谢

All instruction sets contain unconditional branches ("gotos"). The assembly-language syntax might be 'jmp loop', where 'loop' is the label on some instruction. When the program is running, each machine instruction is stored in memory, and hence has a machine address.

a) [8 marks] If the processor executes a 'jmp loop' instruction, and if the instruction that is labeled 'loop' lives at memory address 1,024, what is the value of PC after the 'jmp loop' instruction has completed but before the next instruction in program order has been fetched? In general, how do gotos alter program order?

这个问题几乎暴露了自己。从文本中,我们知道甚至存在的唯一内存地址是 1,024,这确实是答案。

更一般地说,像

这样的语句

jmp loop

在概念上与

相同

mov ip, offset loop(语法无效,通常)

其中 ip 是指令(或程序)计数器。