
158 THE x86 MICROPROCESSORS
MOV CL, N ;move count to CL
MOV DL, ’*’ ;move ‘*’ to DL
AGAIN: MOV AH, 02 ;AH = 2 for displaying a character
INT 21H
DEC CL ;decrement the count
JNZ AGAIN ;repeat the displaying until CL = 0
ENDM ;end the macro
NEW MACRO ;defi ne a macro for moving to next line
MOV DL, 0AH
MOV AH, 02
INT 21H
MOV DL, 0DH
MOV AH, 02
INT 21H
ENDM
STAR 5 ;invoke macro STAR with N = 5
NEW ;invoke macro NEW
STAR 4 ;invoke macro STAR with N = 4
NEW
STAR 3
NEW
STAR 2
NEW
STAR 1
NEW
.EXIT
END
Example 4.13 shows such a case. Two macros have been defi ned – STAR and NEW. e former
contains a label AGAIN which has been dec ...