问题描述
该表包含部分内存:
寄存器具有以下内容:
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)
解决方法
寻址时使用BP
或SP
时,默认段寄存器为SS
,否则为DS
。
用线性地址重写内存转储表的第一列,即代替seg:offs计算16*seg+offs。这给出了地址
07260
07270
07280
07290
072A0
Ad d):pop cx
从 SS:SP
加载一个词,即 0727:002B,对应于线性地址 0729B。在第四行的第 B 列我们可以看到 00 12,所以答案是 cx = 1200h。
Ad e):mov ax,[BP]
从 SS:BP
加载一个词,即 0727:0036,对应于线性地址 072A6。在最后一行的第 6 个位置我们可以看到 18 24,所以答案是 ax = 2418h。