======================================= Assignment #06 - Relocation and Linking ======================================= - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Available online: Friday October 23, 2009 Due date in the Blackboard Assignment Area: due at 08:00 AM on Wednesday October 28, 2009 Answers will be posted after the due date/time so that you can check your answers before coming to class and ask questions in class. Please check your answers (and my answers!). I go over each assignment in class if there are questions about the answers. No questions means no review. See the heading "Homework Exercises / Assignments" in the week01notes.txt file (in the course notes) for the marking scheme for this assignment. Upload Assignment file name template: abcd0001_06_link.txt Use your own userid, not abcd0001. The rest of the name must be exactly as given. Typing mistakes in the name mean no credit. Be precise. 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". Questions based on this web page: 1) Provide a list of the contents of each of the (relocated) three external tables that would be associated with the object code for each of the three modules Main, Pause, and Dble. (That means 3 tables for each of the three modules: 9 tables in all; some of the tables may be empty.) The tables should reflect the relocated locations of the modules loaded in the given order: Main, Pause, Dble. Hint: All this information is already worked out in the web page. 2) Assuming the modules were loaded in the new order Dble, Pause, Main (with the Dble module loading starting at location zero, followed by Pause and then by the Main module), generate the nine new relocated tables that would be associated with the object code for each of the three modules Dble, Pause, and Main. (That means 3 tables for each of the three modules: 9 tables in all; some of the tables may be empty.) The tables should reflect the relocated locations of the modules loaded in the given order: Dble, Pause, Main. 3) Using the tables from the previous question, generate the relocated and linked object code for the Main module loaded at its new address. Show where the Main module actually loads into memory, and show the original object code and the modified (relocated and linked) code for the Main module in its new location. Answer using a multi-column table: Column 1: original address Column 2: original object code Column 3: new address Column 4: new object code Column 5: reason for object code change (if any change) Example five-column table format for your answer: Original New Reason for change -------- ------- ------------------------------------------- 00: 107 20: 127 local reference relocated to +20 01: 000 21: 055 "CALL foo" external subroutine located at 55 02: 600 22: 600 ...