==================================== Project #02 - Relocation and Linking ===================================== - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Available online: Friday October 30, 2009 Due date in the Blackboard Assignment Area: due at 11:45 AM on Tuesday November 10, 2009 Do *not* use the DigitalDropbox to submit your answers. Submission method: Via the "Assignments" DAT2343_Project_2 upload. Due to bugs in Blackboard, you can only submit your Assignment to me *once*. After that, you cannot submit any more times. If you need to re-submit it, you have to ask me to clear your previous submission. Do *not* use the DigitalDropbox to submit your answers. Answers will be posted shortly after the due date/time. Upload Assignment file names (two files to upload): project02_program.txt project02_lmc.txt The name must be exactly as given. Typing mistakes in the name mean no credit. Be precise. (Your userid is not required.) Upload only plain text, not HTML, not MSWord. No fonts. Plain text only. Plain text only. Did I mention that the format is plain text? ------------------ On the "LMCLink.htm" page in the course notes you will find an LMC main program and two subroutines "Pause" and "Dble". Do these things: 1. Move the OUT statement from DBLE to MAIN. DBLE will only double a number; it won't do any output. MAIN will do the output after calling DBLE. 2. Move the CALL PAUSE from DBLE to MAIN as well. Pause after doing the output. You may want to shorten the length of the pause, as you wish. 3. Code Janitor: Move the ARG inside DBLE to the bottom of the code, i.e. to after the JMP that returns to the calling program. Remove the unnecessary "JMP OVERARG" from DBLE. 4. Turn MAIN into a subroutine with input arguments of COUNT and MAX. (Any module that wants to call MAIN has to supply COUNT and MAX before CALLing MAIN.) 5. Create a new module named START that inputs two numbers (for COUNT and MAX), puts the numbers into the subroutine arguments for MAIN, calls the MAIN subroutine, and stops. 6. Link the four modules together into memory in this order: START, PAUSE, MAIN, DBLE. 7. Load your machine code into the LMC simulator and make sure it works. It should input two numbers and loop from the first number to just before (not including) the second, showing the number and its double and pausing after every output. [Updated Oct 31] 8. Choose "Save" to save your working LMC machine code for submission. 9. Add comments to the code, constants, and variables and submit it. No comments; no marks. Submission Method 1. Submit your LMC assembly language code program in usual 6 column format using these column headings in this exact order: Location Code Labels Opcodes Operands Comments Submit your fully commented program code using file name: project02_program.txt No course assignment label is needed on this file, but the Comments field should show clearly the location of each module and the meaning of all the code. Every variable and constant should have a comment. (Not every line of *code* needs a comment; comments must add value.) No comments; no marks. (Comments start with ";" in LMC Assembler.) 2. Choose "Save" in your LMC simulator to save the LMC machine code in a file. Submit the LMC machine code (a list of 100 3-digit numbers) in a file using the file name: project02_lmc.txt No course assignment label is needed on this file. Do not edit the file. I will be loading and running this file. Do not edit the file.