    loa r3 r0           ; get a value from the user

    and r2 r3 1         ; get the low-order bit into r2
    beq r2 r0 else      ; branch to else if even
    add r3 r0 47        ; put 47 in r3
    brs end             ; go to the end of the if/else
else
    add r3 r0 -47       ; put -47 in r3
end

    sto r3 r0           ; print out r3
    hlt