1、将下面程序编译、链接,用Debug加载、跟踪,然后回答问题
assume cs:code,ds:data,ss:stack ↑
│data segment █
│ dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h █
│data ends █
│stack segment █
│ dw 0,0,0,0,0,0,0,0 █
│stack ends █
│code segment █
│ start: mov ax,stack █
│ mov ss,ax █
│ mov sp,16 █
│ mov ax,data █
│ mov ds,ax █
│ push ds:[0] █
│ push ds:[2] █
│ pop ds:[2] █
│ pop ds:[0] █
│ mov ax,4c00h █
│ int 21h █
│code ends █
│end start █
│
1)cpu执行程序,程序返回前,data段的数据为多少?
察看data段的数据,输入d 07e2:0, 看到数据没有变化,符合代码运行的预期。因为在代码中首先把data段数据的前两个字压栈,然后再从栈里pop出来,仍然回到原来的位置。
-d 07e2:0
07E2:0000 23 01 56 04 89 07 BC 0A-EF 0D ED 0F BA 0C 87 09 #.V.............
07E2:0010 00 00 00 00 00 00 15 00-19 00 1D 00 E4 07 02 03 ................
07E2:0020 B8 E3 07 8E D0 BC 10 00-B8 E2 07 8E D8 FF 36 00 ..............6.