Assignment title: Information
CSc
Write a complete program to perform the loading and linking operations for the object programs generated by the SIC/XE assembler.
• The Linking/Loader is to be a separate standalone program.
• Do not include it as part of the assembler.
Input to the Linking/Loader is a variable length list of object program names.
• Programs that do not properly support command line arguments will earn 0 points.
Input Example
Assume loading, linking and running a program that consists of three object program files is desired.
• Object program names: prog1.o, prog2.o, prog3.o // names shown are not required
o Assume that prog1.o is the primary object program file where program execution begins.
o The first object program file listed will always be the primary object program file.
• Command line execution using an executable file named: a.out
o a.out prog1.o prog2.o prog3.o // C/C++ example
o Object programs located in the Project folder with C# and Java
• Object programs will NOT contain any special separator characters (No ^)
o YES: HPROG000000000033 NO: H^PROG^000000^000033
o YES: T00000003032019 NO: T^000000^03^032019
Output Example
Memory contents immediately after the loading and linking process has completed.
• Assume a load address of 03860 (5 digit hexadecimal value – 20 bit address).
• Output requirements:
o written to a file named memload.txt using the following neat and readable format.
o displayed on the screen using the following neat and readable format.
o table borders shown are not required.
• Assume that the memory layout will consist of no more than 25 lines.
• Only display the portion of memory that is actually used by the current loaded and linked program.
o The example below has a program length of 36 bytes (54 bytes base 10).
• Display on the screen the contents of the external symbol table.
ADDR 0 1 2 3 4 5 6 7 8 9 A B C D E F
0386X OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO
0387X OO OO OO ?? OO OO OO OO OO OO OO OO OO OO OO OO
0388X OO OO OO OO OO OO OO OO OO ?? ?? ?? OO OO OO OO
0389X OO OO OO OO OO OO
Execution begins at address: // not always the load address
Each OO pair is replaced by 1 byte of object code produced by the Linking/Loader.
• Uninitialized memory locations (uninitialized storage) are indicated by ??.
o RESB 1 would produce 1 ?? pair (1 pair per byte).
See address 03873
o RESW 1 would produce 3 ?? pairs (3 pairs per word).
See address 03889 through 0388B