assume cs:codesg ,ds:datasg
datasg segment
db '1. file '
db '2. edit '
db '3. seach '
db '4. viwe '
db '5. options '
db '6. help '
datasg ends
codesg segment
start:
mov ax,datasg
mov ds,ax
mov bx,0
mov cx,6
s: mov al,[bx+3]
add al,11011111b
mov [bx+3],al
add bx,16
loop s
mov ax,4c00h
int 21h
codesg ends
end start
debug运行结果:
-r
AX=0000 BX=0000 CX=007D DX=0000 SP=0000 BP=0000 SI=0000 DI=0000
DS=0B50 ES=0B50 SS=0B60 CS=0B66 IP=0000 NV UP EI PL NZ NA PO NC
0B66:0000 B8600B MOV AX,0B60
-d ss:0
0B60:0000 31 2E 20 66 69 6C 65 20-20 20 20 20 20 20 20 20 1. file
0B60:0010 32 2E 20 65 64 69 74 20-20 20 20 20 20 20 20 20 2. edit
0B60:0020 33 2E 20 73 65 61 63 68-20 20 20 20 20 20 20 20 3. seach
0B60:0030 34 2E 20 76 69 77 65 20-20 20 20 20 20 20 20 20 4. viwe
0B60:0040 35 2E 20 6F 70 74 69 6F-6E 73 20 20 20 20 20 20 5. options
0B60:0050 36 2E 20 68 65 6C 70 20-20 20 20 20 20 20 20 20 6. help
0B60:0060 B8 60 0B 8E D8 BB 00 00-B9 06 00 8A 47 03 04 DF .`..........G...
0B60:0070 88 47 03 83 C3 10 E2 F3-B8 00 4C CD 21 2B C6 2E .G........L.!+..
-u
0B66:0000 B8600B MOV AX,0B60
0B66:0003 8ED8 MOV DS,AX
0B66:0005 BB0000 MOV BX,0000
0B66:0008 B90600 MOV CX,0006
0B66:000B 8A4703 MOV AL,[BX+03]
0B66:000E 04DF ADD AL,DF
0B66:0010 884703 MOV [BX+03],AL
0B66:0013 83C310 ADD BX,+10
0B66:0016 E2F3 LOOP 000B
0B66:0018 B8004C MOV AX,4C00
0B66:001B CD21 INT 21
0B66:001D 2BC6 SUB AX,SI
0B66:001F 2E CS:
0B66:0020 01065791 ADD [9157],AX
-g18
AX=0B47 BX=0060 CX=0000 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000
DS=0B60 ES=0B50 SS=0B60 CS=0B66 IP=0018 NV UP EI PL NZ NA PE NC
0B66:0018 B8004C MOV AX,4C00
-t
AX=4C00 BX=0060 CX=0000 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000
DS=0B60 ES=0B50 SS=0B60 CS=0B66 IP=001B NV UP EI PL NZ NA PE NC
0B66:001B CD21 INT 21
-d ds:0
0B60:0000 31 2E 20 45 69 6C 65 20-20 20 20 20 20 20 20 20 1. Eile
0B60:0010 32 2E 20 44 64 69 74 20-20 20 20 20 20 20 20 20 2. Ddit
0B60:0020 33 2E 20 52 65 61 63 68-20 20 20 20 20 20 20 20 3. Reach
0B60:0030 34 2E 20 55 69 77 65 20-20 20 20 20 20 20 20 20 4. Uiwe
0B60:0040 35 2E 20 4E 70 74 69 6F-6E 73 20 20 20 20 20 20 5. Nptions
0B60:0050 36 2E 20 47 65 6C 70 20-20 20 20 20 20 20 20 20 6. Gelp
0B60:0060 B8 60 0B 8E D8 BB 00 00-B9 06 00 8A 47 03 04 DF .`..........G...
为什么结果的第一个字母变成了别的,代码应该没问题,我照着书写的
|