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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started