Question: can some help me write this LC3 Assembly language program? this program must read in two seperate integers and call a subroutine (LARGER) which returns
can some help me write this LC3 Assembly language program? this program must read in two seperate integers and call a subroutine (LARGER) which returns the larger int. the result returned by the subroutine is then displayed by main. the inputs must be passed to the subroutine by the main into register 1 and register 2, and the result (larger) is returned by the subroutine in into register 0.
You must document the protocols for passing parameters and returning the result to/from the subroutine and also follow the convention of saving and restoring registers inside your subroutine.
heres a draft i wrote (i didnt get very far):
.ORIG X3000 LEA R0, IN_STR PUTS
HALT
;*****DATA***** IN_STR .STRINGZ "ENTER TWO SINGLE DIGIT INTEGERS: "
;*****SUBROUTINE*****
.END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
