【发布时间】:2021-06-07 11:14:11
【问题描述】:
该表包含部分内存:
寄存器有以下内容:
DS: 0726
CS: 0624
SS: 0727
ES: 0626
AX: 0003
BX: 0042
BP: 0036
SP: 002B
这些指令之后的结果是什么:
a) mov ax, 10011b ;ax = ____h
b) mov ah, 4[BX] ;ah = ____h
c) mul bl ;ax = ____h
d) pop cx ;cx =____ h
e) mov ax, [BP] ;ax = ________h
请记住,这些说明是相互独立的/沙盒化的。一条指令不会影响下一条
就上下文而言,这不是家庭作业。我正在准备考试,我不知道如何解决这个问题。我刚刚开始研究 8086。
我的结果:
a) ax = 0013h
b) ah = 03h (Probably not, since I'm not sure what the 4 is doing in 4[BX]. Multiplication?)
c) ax = 00C6h
d) cx = ? (I know how to get the address of the top of the stack, it's 729Bh, but I assume the value is in the table above? I don't know how to find it)
e) ax = F6 (Tried to make some sense of the table above. Probably not correct)
【问题讨论】:
-
如果你包含了像
mov eax, [BP]这样的386条指令,你为什么要标记这个emu8086?我假设您仍然应该假设这一切都是在 16 位实模式下完成的(其中段基地址 = 段寄存器 -
该问题以 seg:off 格式为段 =
0726h提供内存内容,可能最简单的方法是将偏移量调整 16 以查看0727h的段基数会“看到”什么内存. -
4[BX]是[BX + 4]的替代语法。语法类似于 Carray[idx]语法,即*(array + idx)。eax是一个 32 位寄存器,4 个字节,在726:0046的内存内容表中没有很多零。 -
谢谢。我会尝试你的建议。我不知道这是一个 386 指令,我认为这是这个问题的作者的错误。
-
EAX 是一个 32 位的寄存器;它在 8086 中不存在。
标签: assembly x86-16 emu8086 memory-segmentation