Complete the LC-3 Guide, before beginning other exercise. Download the LC3tutorial.zip or LC3tutorial.tar file to work on other exercises.
In multc.asm, the program multiples an input by constant value 6. Check to see if the program works correctly. Also try changing the input to test your program. Use the multc.lcs to assemble and load your program files.
We discussed that LC3 has no OR function. However you can use exsisting instructions to produce such a function. Complete or.asm file. Use or.lcs script file to change inputs and test outputs.
Assemble file string.asm and load it. Do not execute the program as this just a psuedo instruction. All the program does it that it loads the string starting at origin mentioned in the program. To test to see ascii values are loaded, use the list command
Write a program (div.asm) to do positive integer long division algorithm. Your program will have two inputs: the dividend and divisor and have two outputs: the quotient and remainder.
For simplicity, assume, you will be given only positive values and the divisor will be always greater than zero. HINT: For division, use the repeated subtraction method i.e. subtract the divisor from the dividend till your result becomes zero. In some case you will have remainder though.
To grade the program, your inputs and outputs are as follows:
Register R1 = Divisor
Register R6 = Dividend
Register R2 = Quotient
Register R3 = Remainder.
Example: R1 = 50, R6 = 105. Therefore 105/50, R2 = 2 and R3 = 5
Use the script file div-test.lcs to assemble, load and to test your program. You can change the values for R1 (Divisor) and R6 (Dividend) to test different cases.
: Submit div.asm on Digital Dropbox via blackboard work by Sunday10/7 by 5 pm.