jmp
label1
ENDM
data .section
’data’
BCnt
db ?
SCnt
db ?
code .section at 0
’code’
Delay BCnt, SCnt
end
The HASM will expand the macro Delay as shown in the following listing
file. Note that the offset of each line in the macro body, from line 1 to line
17, is 0000. Line 24 is expanded to 11 lines and forms the macro body. In
addition the formal parameters, tmp1 and tmp2, are replaced with the
actual parameters, BCnt and SCnt, respectively.
File: t.asm
Holtek Cross-Assembler Version 2.10 Page 1
1 0000
; T.ASM --
2 0000
;
Sample program for MACRO.
3 0000
.ListMacro
4 0000
Delay
MACRO
tmp1, tmp2
5 0000
LOCAL
label1, label2
6 0000
mov
a, 70h
7 0000
mov
tmp1, a
8 0000
label1:
9 0000
mov
tmp2, a
10 0000
label2:
11 0000
clr
wdt1
12 0000
clr
wdt2
13 0000
sdz
tmp2
14 0000
jmp
label2
15 0000
sdz
tmp1
16 0000
jmp
label1
17 0000
ENDM
18 0000
19 0000
data .section
’data’
20 0000 00
BCnt db
?
21 0001 00
SCnt db
?
22 0002
23 0000
code .section at 0
’code’
24 0000
Delay BCnt, SCnt
24 0000 0F70
1 mov a, 70h
24 0001 0080
R1 mov BCnt, a
24 0002
1 ??0000
24 0002 0080
R1 mov SCnt, a
24 0003
1 ??0001:
24 0003 0001
1 clr
wdt1
24 0004 0005
1 clr
wdt2
24 0005 1780
R1 sdz SCnt
24 0006 2803
1 jmp ??0001
Chapter 10 Assembly Language and Cross Assembler
127
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...