第十章的实验11出的有点不同。一是相对简单一些,还有似乎没有用到太多本章的内容。比如MOVSB 就没用到。下面是我的代码
1 assume ds:datasg, cs:code
2 datasg segment
3 db "beginner's All-purpose Symbolic Instruction Code.", 0
4 datasg ends
5 code segment
6 begin: mov ax, datasg
7 mov ds, ax
8 mov si, 0
9 call letterc
10
11 mov ax, 4c00h
12 int 21h
13 letterc:
14 s: mov al, [si]
15 cmp al, 0
16 je eos
17 cmp al, 97
18 jb s0
19 cmp al, 128
20 ja s0
21 and al, 11011111B
22 mov [si], al
23 s0: inc si
24 jmp letterc
25 eos:
26 ret
27 code ends
28 end begin
2 datasg segment
3 db "beginner's All-purpose Symbolic Instruction Code.", 0
4 datasg ends
5 code segment
6 begin: mov ax, datasg
7 mov ds, ax
8 mov si, 0
9 call letterc
10
11 mov ax, 4c00h
12 int 21h
13 letterc:
14 s: mov al, [si]
15 cmp al, 0
16 je eos
17 cmp al, 97
18 jb s0
19 cmp al, 128
20 ja s0
21 and al, 11011111B
22 mov [si], al
23 s0: inc si
24 jmp letterc
25 eos:
26 ret
27 code ends
28 end begin