TITLE Macro Examples - 1 (Macro1.ASM)
; This program demonstrates the MACRO directive.
INCLUDE Irvine32.inc
INCLUDE macros.inc
mPutchar MACRO char
push eax
mov al,char
call WriteChar
pop eax
ENDM
mPrintChar MACRO char,count
LOCAL temp
.data
temp BYTE count DUP(&char),0
.code
push edx
mov edx,OFFSET temp
call WriteString
pop edx
ENDM
mWriteAt MACRO X,Y,literal
mGotoxy X,Y
mWrite literal
ENDM
mPromptInteger MACRO prompt,returnVal
mWrite prompt
call ReadInt
mov returnVal,eax
ENDM
.data
minVal DWORD ?
.code
main PROC
call Clrscr
mWriteAt 15,10,"Hi there is an alphabet:"
call Crlf
;---------------------------------
; Invoke the macro in a loop.
mov al,'A'
mov ecx,26
L1:
mPutchar al
mPutchar ' '
inc al
Loop L1
call Crlf
call WaitMsg
exit
main ENDP
END main
067.在屏幕中间输出字母表
最新推荐文章于 2021-12-01 16:35:18 发布