-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrept.asm
71 lines (50 loc) · 854 Bytes
/
rept.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
; rept.asm
; Test of rept and irp directives.
; Macro with rept and irp inside.
hola macro
local unused, unused2
unused rept 2
db 'Rept inside macro', 0
endm
unused2 irp ?reg, af,bc, de, hl
push ?reg
endm
endm ; hola
;-------------------------------------
rept 10
db 'Hello, reptworld'
endm
rept 3
; Rept with calculated end condition.
n defl 1
rept 0FFFFh
n defl n + 2
if n gt 10
exitm
endif
rept 4
db n
endm
endm
endm
; Macro call inside rept.
rept 2
hola
endm
; New syntax.
counter equ 1234h
; With counter (initial value 0 and step 1 assumed):
rept 3, counter
db counter
endm
; With counter and initial value (step 1 assumed):
rept 3, counter, 5
db counter
endm
; With counter, initial value and step:
rept 3, counter, 7, -1
db counter
endm
; Testing that counter was local:
defw counter
end