CSE 3302 Programming Languages
Fall 05
Programming project #1 (worth 13% of total grade)
Due Mon., Oct. 17th at class time. Turn in a hard copy to me and email a softcopy to the TA. Projects turned in on or before Wed.,Oct. 5th will receive up to 5 points extra credit.
Assignment:
The LC-3 (Little Computer-3) architecture was created by Dr. Yale Patt and Dr. Sanjay Patel in their textbook "Introduction to Computing Systems", Second Edition. The textbook website has a number of resources for students including the LC-3 ISA and a simulator which are linked at the bottom of this assignment. The language has 16 instructions and is completely specified in the Appendix A of the student resources on the website for Drs. Patt and PatelŐs book.
Write an LC-3 assembly language program to solve the given problem below using the LC-3 assembly language instruction set. Translate the assembly language into LC-3 machine language and run your program on the LC-3 simulator which is available to download from http://highered.mcgraw-hill.com/sites/0072467509/
The problem to solve:
The LC-3 has no Divide instruction. A programmer needing to divide two numbers would have to write a routine to handle it. Write a pseudo-code (English-like) algorithm for the process of dividing two integers. Then write an LC-3 machine language program which divides the number in one memory location by the number in a second memory location and stores the quotient at a third memory location and the remainder at a fourth memory location.
You must turn in the following:
A) your pseudo-code division algorithm
B) your program written in LC-3 machine code (binary)
C)
the same program translated into LC-3 assembly code mnemonics (ADD, LDR, register notation etc.)
D)
the output of the program from the LC-3 simulator
Your program will be
graded on the quality of the machine code and the documentation (20%), the
division algorithm pseudo-code (15%), the LC-3 assembly code translation (15%),
and the correctness and completeness of the LC-3 program output (50%)
Useful links: {Please let me know if any of these links is not working}
Student Resources at the Patt/Patel textbook website:
http://highered.mcgraw-hill.com/sites/0072467509/student_view0/
Same site, LC-3 instruction set architecture:
http://highered.mcgraw-hill.com/sites/dl/free/0072467509/104653/PattPatelAppA.pdf
Same site, LC-3 simulator you will use to create your output:
http://highered.mcgraw-hill.com/sites/0072467509/student_view0/lc-3_simulator.html
Class presentation overview of the LC-3 from UC Santa Cruz, Computer Systems and Assembly Language course:
http://www.soe.ucsc.edu/classes/cmpe012c/Summer04/notes/LC3_Architecture_3.pdf