    lcw r1 stack            ; setup the stack
    loa r3 r0               ; get input1
    loa r2 r0               ; get input2

    psh r2                  ; save input2 on the stack
    lcw r2 add              ; setup call to add
    cal r2 r2               ; call add
    pop r0                  ; remove input2 from stack

    sto r3 r0               ; print out the result
    hlt

add
    psh r2                  ; save the return address
    loa r2 r1 4             ; get the second argument
    add r3 r3 r2            
    pop r2                  ; get the return address
    jmp r2                  ; return (answer is in r3)

    dat 100
stack

