COP 3402 Computer Science I - Fall 2000 Loader Assignment, Assignments of Computer Science

Information about an assignment for the computer science i course offered in fall 2000. Students are required to write a loader program that reads object code output by pass2 and loads it into memory. The assignment is written in standard c and must be compiled using gcc. The input and output formats are described in the document.

Typology: Assignments

Pre 2010

Uploaded on 02/25/2010

koofers-user-m9f
koofers-user-m9f 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COP 3402 Computer Science I Fall 2000 - Assignment # 2
Your assignment is to write a loader that reads the object code output by Pass2 and loads it into memory.
There is an example below that shows sample input and the expected output for that input. This
assignment must be written in standard C and will be graded on the Olympus system using the gcc
compiler. Make sure your program works under those conditions.
Rather than actually load the program's object code into a machine, you will be displaying the contents of
the object code file in a format that shows that you correctly read and broke apart the various items.
Input format:
The input format is an object code file produced by Pass2, therefore the format is described in the Pass 2
document. The example below shows a sample input file called ex3.obj and should be compared to the
format described in the Pass 2 document and the output shown below.
The line breaks after the first and next-to-last lines are deliberate, the other line breaks are a result of line
wrapping in the word processor. Therefore, you should consider that there are only 3 lines in this file, the
first line starting with the word PROGRAM, the second line starting with the number 2403 and the third
line starting with the word EXTERN.
The output file name should be based on the input file name, but with the .obj extension changed to .ld
(see the example below).
Output format:
Your program's output goes to a text file and should match the output format shown in the example.
The box below shows the correct screen output format for the above input. Make sure that the phrase
"Your Name Here" is replaced by your actual name. The text in italic indicates the user's input. All other
text is generated by your program.
This assignment is due in class on Thursday Nov 30.
Late assignments must be in by the final exam on Dec 7.
PROGRAM8EXAMPLE3006A
240300004004000A5084000248840002A88050002D400010806418001C84001A48840002C7FFFFE8
1C600028D0000000596F7572204E616D650000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
EXTERN030ASUBROUTINE05MYLIB0000005805SQRTF07MATHLIB0000005C04SUB205MYLIB00000060
COP 3402 Fall 2000 - Assembler Project
Loader Assignment - Your Name Here
Enter input filename: ex3.obj
Starting loader on: ex3.obj...
Loader output written to: ex3.ld
pf2

Partial preview of the text

Download COP 3402 Computer Science I - Fall 2000 Loader Assignment and more Assignments Computer Science in PDF only on Docsity!

COP 3402 Computer Science I Fall 2000 - Assignment # 2

Your assignment is to write a loader that reads the object code output by Pass2 and loads it into memory.

There is an example below that shows sample input and the expected output for that input. This

assignment must be written in standard C and will be graded on the Olympus system using the gcc

compiler. Make sure your program works under those conditions.

Rather than actually load the program's object code into a machine, you will be displaying the contents of

the object code file in a format that shows that you correctly read and broke apart the various items.

Input format:

The input format is an object code file produced by Pass2, therefore the format is described in the Pass 2

document. The example below shows a sample input file called ex3.obj and should be compared to the

format described in the Pass 2 document and the output shown below.

The line breaks after the first and next-to-last lines are deliberate, the other line breaks are a result of line

wrapping in the word processor. Therefore, you should consider that there are only 3 lines in this file, the

first line starting with the word PROGRAM, the second line starting with the number 2403 and the third

line starting with the word EXTERN.

The output file name should be based on the input file name, but with the .obj extension changed to. ld

(see the example below).

Output format:

Your program's output goes to a text file and should match the output format shown in the example.

The box below shows the correct screen output format for the above input. Make sure that the phrase

"Your Name Here" is replaced by your actual name. The text in italic indicates the user's input. All other

text is generated by your program.

This assignment is due in class on Thursday Nov 30.

Late assignments must be in by the final exam on Dec 7.

PROGRAM8EXAMPLE3006A

240300004004000A5084000248840002A88050002D400010806418001C84001A48840002C7FFFFE

1C600028D0000000596F7572204E616D

EXTERN030ASUBROUTINE05MYLIB0000005805SQRTF07MATHLIB0000005C04SUB205MYLIB

COP 3402 Fall 2000 - Assembler Project Loader Assignment - Your Name Here Enter input filename: ex3.obj Starting loader on: ex3.obj... Loader output written to: ex3.ld

The box below shows the correct file output format for the above input. Again, make sure that the

phrase "Your Name Here" is replaced by your actual name.

Note that the output includes exactly the number of bytes specified and that all numbers are displayed in

hexadecimal format. Compare this output with the input shown above and the Pass 2 output format

description to determine what you are supposed to be doing.

This assignment is due in class on Thursday Nov 30.

Late assignments must be in by the final exam on Dec 7.

Your Name Here - Fall 2000 Semester Program: EXAMPLE3 is 6A bytes in length. Address 0000: 24030000 Address 0004: 4004000A Address 0008: 50840002 Address 000C: 48840002 Address 0010: A Address 0014: 2D Address 0018: 80641800 Address 001C: 1C84001A Address 0020: 48840002 Address 0024: C7FFFFE Address 0028: 1C Address 002C: D Address 0030: 596F Address 0034: 204E616D Address 0038: 65000000 Address 003C: 00000000 Address 0040: 00000000 Address 0044: 00000000 Address 0048: 00000000 Address 004C: 00000000 Address 0050: 00000000 Address 0054: 00000000 Address 0058: 00000000 Address 005C: 00000000 Address 0060: 00000000 Address 0064: 00000000 Address 0068: 0000 There are 3 External References: External Reference: SUBROUTINE in: MYLIB at: 0058 External Reference: SQRTF in: MATHLIB at: 005C External Reference: SUB2 in: MYLIB at: 0060