map in assembler
(define (map f l) (if (null? l) nil (cons (f (car l)) (map f (cdr l)))))
map: gettag tag, arg2
cmp tag, #4
jump.ne next
settag val, #4
rts
next: push arg1
push arg2
getcdr arg2, arg2
jsr map
pop arg2
pop arg1
push val
load proc, arg1
getcar arg1, arg2
jsr 0(proc)
load arg1, val
pop val
load arg2, val
jsr cons
rts