Question: ; This is a program to multiply two numbers. ; The program first stores a number into address x3100. ; The program then stores a

 ; This is a program to multiply two numbers. ; The

; This is a program to multiply two numbers. ; The program first stores a number into address x3100. ; The program then stores a second number into x3101. ; In a more complete program the two numbers would be read from the keyboard. ; In a more complete program the result would be written to the monitor.

0011 000 000000000 ; Load address x3000 as the start location

; clear R0 and R1 0101 000 000 1 00000 ; R0

; store values into R0 and R1 0001 000 000 1 00101 ; R0

; store values from R0 and R1 into memory 0011 000 0 1111 1011; x3100

; clear R0 and R1 0101 000 000 1 00000 ; R0

; The multiply program starts here.

; Add code below to complete the assignment requirements.

; Do NOT change any of the code above except to add a header comment with your name(s)

1111 0000 0010 0101 ; halt the program (TRAP with vector x25)

2. The LC-3 does not have a multiply instruction. You will write a machine code (1s and 0s) program to allow for multiplication of two numbers. Your program will include the features listed below in steps a through d. It's best to complete each step and test before moving to the next step. Test to make sure that the program works in LC3. No credit if you write code in assembly. Your machine code file name must be Multiply bin a. Load register R3 with the number stored in memory location 3100. Load register R4 with the number stored in memory location 3101. The provided starter code already places data in these two memory locations. b. Write machine code to multiply the contents of R3 with the contents of R4. The result must be stored in R5. In other words, R5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!