Chapter 4 Assembly Language and Cross Assembler
The following source program refers to the macro Delay:
;
;
T . A S M
S a m p l
. L i s t M a c
D e l a y M A
L O
m o
m o
l a b e l 1 :
m o
l a b e l 2 :
c l
c l
s d
j m
s d
j m
E N
e
d a t a
B C n t
S C n t
p r o g
r o
C R O
t
C A L
l
v
a
v
t
v
r
r
z
p
z
p
r a m
m p
a b
,
m p
f o r
M A C R O .
1 , t m p 2
e l 1 , l a b e l 2
7 0 h
1 , a
a
t m p 2 ,
w d
w d
t m
l a
t m
l a
t 1
t 2
p 2
b e l 2
p 1
b e l 1
D M
. s e c t i o n
d b ?
d b ?
' d a t a '
c o d e . s e c t i o n a t
D e l a y B C n t , S C n t
e n d
0
' c o d e '
The Cross Assembler 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 4 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.
F i l e :
1
2
3
4
5
6
7
8
T . a s m
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 1
0 2
0 0
0 0
0 0
0 1
0 2
0 2
0 3
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0
H o l t e k
;
;
C r o s s - A s s e m b l e r
e
p r o g
r o
C R O
t
C A L
l
v
a
v
t
v
r
r
z
p
z
p
r a m
m p
a b
,
m p
V e r s i o n
f o r
M A C R O .
2 . 8 0
P a g e
1
9
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
2 0
2 1
2 2
2 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 5
T . A S M
S a m p l
. L i s t M a c
D e l a y M A
L O
m o
m o
l a b e l 1 :
m o
l a b e l 2 :
c l
c l
s d
j m
s d
j m
E N
d a t a
B C n t
S C n t
1 , t m p 2
e l 1 , l a b e l 2
7 0 h
1 , a
a
t m p 2 ,
w d
w d
t m
l a
t m
l a
t 1
t 2
p 2
b e l 2
p 1
b e l 1
D M
0 0
0 0
. s e c t i o n
d b ?
d b ?
c t i o n
n t , S C
v
a
v
B
v
r
r
z
p
z
p
' d a t a '
0 F 7 0
0 0 8 0
0 0 8 0
0 0
0 0
1 7
2 8
1 7
2 8
0 1
0 5
8 0
0 3
8 0
0 2
1
R 1
1
R 1
1
1
1
R 1
1
R 1
1
c o d e . s e
D e l a y B C
m o
m o
? ? 0 0 0 0 :
m o
? ? 0 0 0 1 :
c l
c l
s d
j m
s d
j m
e n d
a t 0 ' c o d e '
n t
, 7 0 h
C n t , a
S C n t ,
w d
w d
S C
? ?
B C
? ?
t 1
t 2
n t
0 0 0 1
n t
0 0 0 0
a
E r r o r s
147
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index