汇编语言基本概念(续4)
前面讲的汇编编辑有两种方式,一种是通过DEBUG的A命令,另一种是通过文本编辑器,这两种编辑器编辑好的命令是不一样的,前一种可以直接通过DEBUG的t命令进行直接执行,后一种还需要经过MASM编译后才能用DEBUG调试,这里有一点点不同,不同有两点,每一点在于[0]表示上,DEBUG中[0]表示偏移量,而MASM中只表十进制0 第二点,数值默认在DEBUG是十六进制,而MASM是十进制。对同一段代码示例如下:
【1】使用DEBUG命令实现
D:\Temp\npp.5.9.3.bin\tmp>debug
-r
AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13F9 ES=13F9 SS=13F9 CS=13F9 IP=0100 NV UP EI PL NZ NA PO NC
13F9:0100 0000 ADD [BX+SI],AL DS:0000=CD
-a 13F9:0
13F9:0000 mov ax,2000
13F9:0003 mov ds,ax
13F9:0005 mov al,[0]
13F9:0008 mov bl,[1]
13F9:000C mov cl,[2]
13F9:0010 mov dl,[3]
13F9:0014
-r ip
IP 0100
:0
-r
AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13F9 ES=13F9 SS=13F9 CS=13F9 IP=0000 NV UP EI PL NZ NA PO NC
13F9:0000 B80020 MOV AX,2000
-u
13F9:0000 B80020 MOV AX,2000
13F9:0003 8ED8 MOV DS,AX
13F9:0005 A00000 MOV AL,[0000]
13F9:0008 8A1E0100 MOV BL,[0001]
13F9:000C 8A0E0200 MOV CL,[0002]
13F9:0010 8A160300 MOV DL,[0003]
13F9:0014 5D POP BP
13F9:0015 0E PUSH CS
13F9:0016 1404 ADC AL,04
13F9:0018 0304 ADD AX,[SI]
13F9:001A 050002 ADD AX,0200
13F9:001D FFFF ??? DI
13F9:001F FFFF ??? DI
-t
AX=2000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13F9 ES=13F9 SS=13F9 CS=13F9 IP=0003 NV UP EI PL NZ NA PO NC
13F9:0003 8ED8 MOV DS,AX
-t
AX=2000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=2000 ES=13F9 SS=13F9 CS=13F9 IP=0005 NV UP EI PL NZ NA PO NC
13F9:0005 A00000 MOV AL,[0000] DS:0000=00
-d 2000:0
2000:0000 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0040 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0060 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
2000:0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
-t
AX=2000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=2000 ES=13F9 SS=13F9 CS=13F9 IP=0008 NV UP EI PL NZ NA PO NC
13F9:0008 8A1E0100 MOV BL,[0001] DS:0001=00
-t
AX=2000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=2000 ES=13F9 SS=13F9 CS=13F9 IP=000C NV UP EI PL NZ NA PO NC
13F9:000C 8A0E0200 MOV CL,[0002] &
补充:软件开发 , 其他 ,