



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Machine Instructions, Assembly Language, Language Program, Program Segment, Given Machine, Handle Branches, Hexadecimal Byte, Byte Address, Relocation Entry, Cast Converts
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




Put your login name on each page. Also make sure you have provided the informa-
Consider the following three machine instructions, which appear in memory starting at the address 0x00400000.
address (in hex) contents (in hex) 00400000 12080002 00400004 3C11FFFF 00400008 08100004
Part a “Disassemble”the instructions; that is, give an assembly language program segment
appears at the end of this exam. Handle branches and jumps specially; where you would normally have a label, pro-
first instruction as j 0x
bltz $9,0x
Part b
Your login name: c^ s^6 1 c
it could not have contributed an entry to the relocation table. Briefly explain your answers.
address (in hex) contents (in hex)
00400000
00400004
00400008
12080002
3 CllFFFF
08100004
explanation of why this instruction must have, may have, or could not contribute relocation entry
Your login name: c^ s^6 lc-,
Part c
Give the largest (signed) hexadecimal integer value that k could contain and still produce the output
Briefly explain your answer.
no change after conversion to float
Part d
mal) of your answer to part c. Show how you got your answer.
45
Your login name: c^ s^6 1 c
Both parts of this question involve code from our solution to lab assignment 9, which appears at the end of this exam.
modifications are necessary).
buffer: .space 2
Execution traces
I p r i n t c h k f u l l i n t r p no t E m pt y intDone p r i n t chkfull i n t r p notEmpty intDone p r i n t chkfull i n t r p notEmpty i n t Done p r i n t alldone loop
1 7 1 6 25 3 3. 43 49 # 103 1 0 3 9 1 0 4 7 1 0 6 4
2053 2 0 6 1 2077 2080 2081-inf
p r i n t 1 chkfull i n t r p not E m p t y intDone p r i n t chkfull p r i n t chkfull i n t r p notEmpty intDone x i n t illdone .oop .ntrp
ntDone OOP
1otEmpty
7 1 6 25 3 3 43 49 59
1 0 3 9 1 0 4 7 1 0 6 5 1 0 6 8 1069- 2044 2053 2 0 6 1 2070 - w
IUUI- 1og-m name: (^) C S ~ ~ C -
p r i n t 1 chkfull 7 i n t r p 1 6 notEmpty 25 intDone 1 0 3 3 p r i n t 1 0 4 3 chkfull 1 0 4 9 i n t r p 1 0 5 4 notEmpty 1 0 6 3 intDone 2 0 7 1 p r i n t 2 0 8 1 chkfull 2 0 8 7 i n t r p 2 0 9 2
intDone 3 1 0 8 p r i n t 3 1 1 8 alldone 3 1 2 1
notEmpty 2 1 0 1
loop 3122-inf