main:
:
LDR R0, R6, #3 ; load a
STR R0, R6, #8 ; store the first argument to NoName
AND R0, R0, #0 ; R0 <- 0
ADD R0, R0, #10 ; R0 <- 10
STR R0, R6, #9 ; store the third argument to NoName
STR R6, R6, #7 ; store R6 into the dynamic link of rec
; we pushed a new record on the stack
ADD R6, R6, #5 ; move R6 to point to start of record
JSR NoName
LDR R0, R6, #5 ; load the return value
; (just beyond actrec for main)
STR R0, R6, #4 ; b = NoName(a, 10);
:
NoName:
STR R7, R6, #1 ; store return address
:
: ; the body of NoName
:
LDR R0, R6, #6 ; load the value of y
STR R0, R6, #0 ; store it into the return value entry
LDR R7, R6, #1 ; load the return address
LDR R6, R6, #2 ; load the dynamic link
RET