assembly - 程序集 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)
解决方案
寻址时使用BP
orSP
时,默认段寄存器为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。
推荐阅读
- spring-boot - NoSuchMethodError SpringBoot 启动失败
- c - 是否可以在没有单独的查找表的情况下为一组小(<64)键创建最小完美哈希函数?
- cakephp - Cakephp 在 cpanel 中从 2.7 迁移到 2.8
- mongodb - 获取大 Mongodb 集合的不同值数组
- javascript - 在 JS 脚本中,Edge 抛出错误 5002 Function expected on object field declaration
- c# - 错误:在获取属性中引发了“System.StackOverflowException”类型的异常
- java - Java - 连接四游戏不会在三个以上堆叠不同的计数器
- angular - 具有 30 000 行的 mat-table 的性能
- apache-kafka - 如何让 Kafka 消费者检测到不存在的主题并将其从元数据中删除?
- git - BitBucket Server Git - 只允许从分支 UAT 合并到 master