FIGURE 8.3 The loader of the Pep/9 operating system. ; ******* System Loader ;Data must be in the following format: ; Each hex number representing a byte must contain exactly two ; characters. Each character must be in 0..9, A. .F, or a. .f and ; must be followed by exactly one space. There must be no ; leading spaces at the beginning of a line and no trailing ; spaces at the end of a line. The last two characters in the ; file must be lowercase zz, which is used as the terminating ; sentinel by the loader. i FC17 C80000 loader: LDWX 0, i ;X < 0 FC1A D1FC15 get Char: LDBA charin, d ; Get first hex character FC1D B0007A CPBA FC20 18FC51 BREQ 'z', i stopLoad ; If end of file sentinel 'z' i then exit loader routine FC23 B00039 CPBA FC26 14FC2C BRLE FC29 600009 ADDA '9',i shift 9, i FC2C ОА shift: ASLA FC2D ОА ASLA FC2E OA ASLA FC2F OA ASLA FC30 F1FC10 STBA FC33 D1FC15 LDBA FC36 B00039 CPBA byte Temp,d charIn, d '9',i FC39 14FC3F BRLE combine FC3C 600009 ADDA 9, i FC3F 80000F combine: ANDA FC42 91FCOF ORA FC45 F50000 STBA 0,x FC48 680001 ADDX 1, i FC4B D1FC15 LDBA charin, d FC4E 12FC1A BR getChar 0x000F, i wordTemp, d ; If character <= '9', assume decimal ; and right nybble is correct digit ; else convert nybble to correct digit ; Shift left by four bits to send ; the digit to the most significant ; position in the byte ; Save the most significant nybble ; Get second hex character ; If character <= '9', assume decimal ; and right nybble is correct digit ; else convert nybble to correct digit ;Mask out the left nybble ; Combine both hex digits in binary ; Store in Mem [X] ;X < X + 1 <- ; Skip blank or i FC51 00 stopLoad: STOP ;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 3PP: (Data processing) Write a C++ program that allows the user to enter the following information from...
icon
Related questions
Question

Assume that the loop from FC1A to FC4E is executing for the 30th time. State the values in the following registers as four hexadecimal digits:

(e) A〈8..15〉 after ANDA at FC3F

Assume that the loop from FC1A to FC4E is executing for the 32b time. State the values in the following registers as four hexadecimal digits:

*(b) A〈8..15〉before ASLA at FC2C

FIGURE 8.3
The loader of the Pep/9 operating system.
; ******* System Loader
;Data must be in the following format:
; Each hex number representing a byte must contain exactly two
; characters. Each character must be in 0..9, A. .F, or a. .f and
; must be followed by exactly one space. There must be no
; leading spaces at the beginning of a line and no trailing
; spaces at the end of a line. The last two characters in the
; file must be lowercase zz, which is used as the terminating
; sentinel by the loader.
i
FC17 C80000 loader: LDWX
0, i
;X < 0
FC1A D1FC15 get Char: LDBA
charin, d
; Get first hex character
FC1D B0007A
CPBA
FC20 18FC51
BREQ
'z', i
stopLoad
; If end of file sentinel 'z'
i
then exit loader routine
FC23 B00039
CPBA
FC26 14FC2C
BRLE
FC29 600009
ADDA
'9',i
shift
9, i
FC2C ОА
shift:
ASLA
FC2D ОА
ASLA
FC2E OA
ASLA
FC2F OA
ASLA
FC30 F1FC10
STBA
FC33 D1FC15
LDBA
FC36 B00039
CPBA
byte Temp,d
charIn, d
'9',i
FC39 14FC3F
BRLE
combine
FC3C 600009
ADDA
9, i
FC3F 80000F combine: ANDA
FC42 91FCOF
ORA
FC45 F50000
STBA
0,x
FC48 680001
ADDX
1, i
FC4B D1FC15
LDBA
charin, d
FC4E 12FC1A
BR
getChar
0x000F, i
wordTemp, d
; If character <= '9', assume decimal
; and right nybble is correct digit
; else convert nybble to correct digit
; Shift left by four bits to send
; the digit to the most significant
;
position in the byte
; Save the most significant nybble
; Get second hex character
; If character <= '9', assume decimal
; and right nybble is correct digit
; else convert nybble to correct digit
;Mask out the left nybble
; Combine both hex digits in binary
; Store in Mem [X]
;X < X + 1
<-
; Skip blank or <LF>
i
FC51 00
stopLoad: STOP
;
Transcribed Image Text:FIGURE 8.3 The loader of the Pep/9 operating system. ; ******* System Loader ;Data must be in the following format: ; Each hex number representing a byte must contain exactly two ; characters. Each character must be in 0..9, A. .F, or a. .f and ; must be followed by exactly one space. There must be no ; leading spaces at the beginning of a line and no trailing ; spaces at the end of a line. The last two characters in the ; file must be lowercase zz, which is used as the terminating ; sentinel by the loader. i FC17 C80000 loader: LDWX 0, i ;X < 0 FC1A D1FC15 get Char: LDBA charin, d ; Get first hex character FC1D B0007A CPBA FC20 18FC51 BREQ 'z', i stopLoad ; If end of file sentinel 'z' i then exit loader routine FC23 B00039 CPBA FC26 14FC2C BRLE FC29 600009 ADDA '9',i shift 9, i FC2C ОА shift: ASLA FC2D ОА ASLA FC2E OA ASLA FC2F OA ASLA FC30 F1FC10 STBA FC33 D1FC15 LDBA FC36 B00039 CPBA byte Temp,d charIn, d '9',i FC39 14FC3F BRLE combine FC3C 600009 ADDA 9, i FC3F 80000F combine: ANDA FC42 91FCOF ORA FC45 F50000 STBA 0,x FC48 680001 ADDX 1, i FC4B D1FC15 LDBA charin, d FC4E 12FC1A BR getChar 0x000F, i wordTemp, d ; If character <= '9', assume decimal ; and right nybble is correct digit ; else convert nybble to correct digit ; Shift left by four bits to send ; the digit to the most significant ; position in the byte ; Save the most significant nybble ; Get second hex character ; If character <= '9', assume decimal ; and right nybble is correct digit ; else convert nybble to correct digit ;Mask out the left nybble ; Combine both hex digits in binary ; Store in Mem [X] ;X < X + 1 <- ; Skip blank or <LF> i FC51 00 stopLoad: STOP ;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr