汇编 之 子程序(eg : 小写字母 -> 大写字母)
*/
// [11/1/2014 JmingS]
/*
汇编里,如何用子程序。。。(小例子)
// 例子:小写字母 -> 大写字母
// 子程序:实现换行
*/
1 stack segment stack 2 db 1024 dup(?) 3 stack ends 4 5 data segment 6 data ends 7 8 code segment 'code' 9 assume ss:stack, ds:data, cs:code 10 11 start: 12 mov ax, data 13 mov ds, ax 14 15 mov ah, 1h 16 int 21h 17 18 call dpcrlf 19 20 sub al, 20h 21 mov ah, 02h 22 mov dl, al 23 int 21h 24 25 mov ah, 4ch 26 int 21h 27 28 dpcrlf proc 29 push ax 30 push dx 31 mov ah, 2 32 mov dl, 0dh 33 int 21h 34 mov ah, 2 35 mov dl, 0ah 36 int 21h 37 pop dx 38 pop ax 39 ret 40 dpcrlf endp 41 42 code ends 43 end start