NAME
:sym[SIZE
:jsize] "[
" [["sav:
"] PARAMETERS
:args] "]
"
sav:
is declared, stores the RL1
registers (declared in the procedure definition) in the stack.
PARAMETERS
into RL1
.
NAME
.
sav:
is declared, the RL1
registers are restored.
SIZE
is the size to be used for the bsr (default: none).
SIZE
is .l
, the jsr instruction is used instead of bsr.l to easily allow calls to other code sections.
WaitMouse.s[]
...
procedure loc:WaitMouse[]
.w btst.b #6,$bfe001
bne.s .w
eproc
assembly
bsr.s .0000000
...
.0000000
.w btst.b #6,$bfe001
bne.s .w
.0000001 rts
SlowClr[sav: #buffer,d1]
...
procedure SlowClr[a0/d0.b],a0/d1
move.l d0,d1
lsr.l #2,d1
subq.l #1,d1
.c clr.l (a0)+
dbra d1,.c
eproc
assembly
movem.l a0/d0,-(sp) ;preserve RL1 registers
move.l #buffer,a0 ;load
move.b d1,d0 ;parameters
bsr p0000000 ;execute procedure
movem.l (sp)+,a0/d0 ;restore RL1 registers
...
p0000000 movem.l a0/d1,-(sp)
move.l d0,d1
lsr.l #2,d1
subq.l #1,d1
.c clr.l (a0)+
dbra d1,.c
p0000001 movem.l (sp)+,a0/d1
rts
SlowClr.l[sav: #buffer,d0]
assembly
movem.l a0/d0,-(sp)
move.l #buffer,a0
jsr p0000000
movem.l (sp)+,a0/d0
(SlowClr[]
is defined in the previous example.)