首页 > 解决方案 > 程序集 8086 - 查找指令结果

问题描述

该表包含部分内存:

在此处输入图像描述

寄存器有以下内容:

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)

标签: assemblyx86-16emu8086memory-segmentation

解决方案


寻址时使用BPorSP时,默认段寄存器为SS,否则为DS. 用线性地址重写内存转储表的第一列,即代替 seg:offs 计算 16*seg+offs。这给出了地址

07260
07270
07280
07290
072A0

加d):从 0727: 002Bpop cx加载一个字SS:SP,对应线性地址 0729B。在第四行的第 B 列我们可以看到 00 12,所以答案是cx = 1200h

广告e)mov ax,[BP]从 0727:0036 加载一个字SS:BP,对应线性地址 072A6。在最后一行的第 6 位,我们可以看到 18 24,所以答案是ax = 2418h


推荐阅读