The loader in Figure 8.3 executes with the following input: 04 00 05 00 00 31 00
ID: 3548882 • Letter: T
Question
The loader in Figure 8.3 executes with the following input:
04 00 05 00 00 31 00 03 39 00 03 50 00 0A 41 00
12 00 54 68 61 74 27 73 20 61 6C 6C 2E 0A 00 zz
Assume that the loop from FC5D to FC97 is executing for the 27th time. State the
values in the following registers as four hexadecimal digits:
*(e) A after ANDA at FC88
. The following program executes, generating an interrupt for DECI :
0000 040005 BR mai n ; Branch around data
0003 0000 num: . BLOCK 2 ; Gl obal vari abl e
;
0005 310003 mai n: DECI num, d ; I nput deci mal val ue
0008 390003 DECO num, d ; Out put deci mal val ue
000B 50000A CHARO ' ' , i
000E 410012 STRO msg, d ; Out put message
0011 00 STOP 0012 546861 msg: . ASCI I "That' s al l . "
742773
20616C
6C2E0A
00
001F . END
For Figure 8.6, the entry to and exit from the trap handler, state the values in the fol-
lowing registers as four hexadecimal digits:
(c) X after SUBX at FCBA
Explanation / Answer
Object
Addr code Symbol Mnemon Operand Comment
0000 04000D BR main ;Branch around data
0003 0000 num: .BLOCK 2 ;Storage for one integer
0005 202B20 msg: .ASCII " + 1 = "
31203D
2000
;
000D 310003 main: DECI num,d ;Get the number
0010 390003 DECO num,d ;and output it
0013 410005 STRO msg,d ;Output ' + 1 = '
0016 C10003 LDA num,d ;A := the number
0019 700001 ADDA 1,i ;Add one to it
001C E10003 STA num,d ;Store the sum
001F 390003 DECO num,d ;Output the sum
0022 00 STOP
0023 .END
Symbol table:
Symbol Value Symbol Value
main 000D msg 0005
num 0003
Input
-479
Output
-479 + 1 = -478
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.