汇编程序42:实验11 编写子程序
1 assume cs:code,ds:data 2 //锁定小写字母,从而改写,使用cmp与条件指令配合 3 data segment 4 db "Beginner's All-purpose Symbolic Instruction Code.",0 5 data ends 6 7 code segment 8 begin: 9 mov ax,data 10 mov ds,ax 11 call letterc 12 mov ax,4c00h 13 int 21h 14 letterc: 15 mov si,0 16 mov cx,30h 17 main: 18 mov al,ds:[si] 19 cmp al,0 20 je ok 21 cmp al,61h 22 jb next 23 cmp al,7ah 24 ja next 25 and al,11011111b 26 mov ds:[si],al 27 next: 28 inc si 29 loop main 30 ok: 31 ret 32 code ends 33 34 end begin