17
22/08/2003
Copyright Teemu Kerola 2003
Viiteparam.
(jatk)
(1)
aliohjelman toteutus:
parX
EQU
-4 ; relative to FP
parY
EQU
-3
parpZ
EQU
-2 ; call-by-ref
procB
PUSH
SP, R1 ; save R1
LOAD R1, parX (FP)
MUL
R1, =5
ADD
R1, parY (FP)
STORE R1, @parpZ (FP)
POP
SP, R1; restore R1
EXIT
SP, =3 ; 3 param.
prolog
epilog
vanha FP
vanha PC
vanha R1
param x
param y
vparam pZ
FP
SP
procB (x, y: int, var pZ:int)
{
pZ = x * 5 + y;
return;
}
…
procB (200, R, T);
ks. procB.k91