例9.19
编写一个显示字符串的宏指令PRINT
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
;eg9-19.asm
;Purpose: print a string in given address
;Usage: PRINT str_addr
;Entry: macro parameter str_addr = string address
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
print macro str_addr
push dx ;save registers
push ax
;print the string
mov dx, offset str_addr ;dx<=address of the string
mov ah, 09 ;to display string
int 21h ;call DOS
;restore registers
pop ax
pop dx
endm
;--------------------------------------------------------------