SP HW5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

PALESTINE POLYTECHNIC UNIVERSITY

COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTER ENGINEERING


SYSTEMS PROGRAMMING - SPRING2020
HOMEWORK #5
INSTRUCTOR: ENG. YOUSEF A.
SALAH

Q1) The following program consists of three control sections; Assume the first control section
called PROG1 looks like:

Object
Loc Code

0000 PROG1 START 0


EXTDEF LISTA, ENDA
EXTREF LISTB, ENDB, LISTC, ENDC
...
0020 REF1 LDA LISTA 03201D
0023 REF2 +LDT LISTB+4
77100004
0027 REF3 LDX #ENDA-LISTA 050014
...
0040 LISTA EQU *
...
0054 ENDA EQU *
0054 REF4 WORD LISTC 000000
0057 REF5 WORD LISTB – 3 FFFFFD
005A REF6 WORD LISTA+LISTB 000040
005D REF7 WORD ENDC-LISTC-100 FFFF9C
0060 REF8 WORD LISTA-LISTB-ENDA+ENDB FFFFEC
END REF1

Answer the followings:


1) Generate the object code for the instructions and directives in PROG1. (8 Shaded Parts)
Solution in the original question.
2) What is the generated object file of PROG1?

H^PROG1 ^000000^000063

D^ LISTA^000040^ ENDA^000054

R^ LISTB^ ENDB^LISTC^ENDC

T^000020^0A^03201D^77100004^050014

…….
T^000054^0F^000000^FFFFFD^FFFF9C^FFFFEC

M^000024^05^+ LISTB

M^000054^06^+ LISTC

M^000057^06^+ LISTB

M^00005A^06^+ LISTB

M^00005A^06^+ PROG1

M^00005D^06^+ ENDC

M^00005D^06^ -LISTC

M^000060^06^+ PROG1
M^000060^06^-PROG1
M^000060^06^ -LISTB
M^000060^06^+ ENDB
E^000020

3) Assume PROGADDR = 250016, and the loader loaded PROG1, PROG2 and PROG3
consecutively, and the ESTAB is:

Control Symbol Address Length


Section Name (Hex) (Hex)
PROG1 2500 63
LISTA 2540
ENDA 2554
PROG2 2563 7F
LISTB 25C3
ENDB 25D3
PROG3 25E2 51
LISTC 2612
ENDC 2624

(a) Fill in the missing parts in the ESTAB (5 shaded parts).


Solution in the original question.

(b) Based on 250016 as a PROGADDR, what are the actual values of REF4, REF5, and
REF6 in PROG1?

REF4:002612
REF5:0025C0
REF6:004B03

(c) What is the value of EXEADDR?


Q2)

Q3)

You might also like