NAME
:sym[SIZE
:jsize] "[
" [["sav:
"] PARAMETERS
:args] "]
"
sav:
is declared, stores the RL1
registers (declared in the function 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 instruction jsr is used instead of bsr.l to easily allow calls to other code sections.
sav:
is specified make sure that OUT
(returned by the function), is not a register included in RL1
.
move.w SetDMA.l[#$f],OldDMA
...
move.w SetDMA[sav:#$f],OldDMA
assembly
move.w #$f,d0 ;load parameter
jsr f0000000 ;execute function
move.w d0,OldDMA ;store first result - OK
...
movem.l d0,-(sp) ;preserve RL1 registers
move.w #$f,d0 ;load parameter
bsr f0000000 ;execute function
movem.l (sp)+,d0 ;restore RL1 registers
move.w d0,OldDMA ;store second result - WRONG
(SetDMA[]
is defined here.)
bool #24 = GetMess[],d7
assembly
bsr f0000002 ;execute function
cmpi.b #24,MessAmount ;evaluate boolean expression
seq.b d7 ;and set result
(GetMess[]
is defined here.)