LC3Tools ✰ 1 .ORIG x3000 opgave2.asm AND RO, RO, #0 ; Read first digit GETC OUT LD R1, ASCII_OFFSET ADD RO, RO, R1 ADD RO, RO, #-48 ADD RO, RO, RO 2 3 readS 4 LEA RO, prompt PUTS 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 RET 25 ; Read second digit GETC OUT LD R1, ASCII_OFFSET ADD R2, RO, R1 ADD R2, R2, #-48 ADD RO, RO, R2 ; Load effective address of prompt message ; Display prompt message ; Clear RO to store the result ; Read first digit ; Echo first digit ; Load ASCII offset to subtract from digit character ;Convert digit character to integer ; Convert ASCII digit to integer ; Shift to left to make room for second digit ; Read second digit ; Echo second digit ; Load ASCII offset to subtract from digit character ; Convert digit character to integer ;Convert ASCII digit to integer ; Combine first and second digit ; Return from function 26 prompt .STRINGZ "Input a 2 digit decimal number: 27 ASCII_OFFSET .FILL XFFD0 " ; ASCII offset to convert digit character to integer 28 LEND 22 /Users/omar/Desktop/opgave2.asm: 21:20: error: cannot encode as 5-bit 2's complement number ADD R2, R2, #23-48 122~

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

I get an error in LC3 assembly programming when i try to run this code. can someone explain how i can fix this and give me the solution to the fix. i will be very thankfull

LC3Tools ✰
1 .ORIG x3000
opgave2.asm
AND RO, RO, #0
; Read first digit
GETC
OUT
LD R1, ASCII_OFFSET
ADD RO, RO, R1
ADD RO, RO, #-48
ADD RO, RO, RO
2
3 readS
4
LEA RO, prompt
PUTS
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
RET
25
; Read second digit
GETC
OUT
LD R1, ASCII_OFFSET
ADD R2, RO, R1
ADD R2, R2, #-48
ADD RO, RO, R2
; Load effective address of prompt message
; Display prompt message
; Clear RO to store the result
; Read first digit
; Echo first digit
; Load ASCII offset to subtract from digit character
;Convert digit character to integer
; Convert ASCII digit to integer
; Shift to left to make room for second digit
; Read second digit
; Echo second digit
; Load ASCII offset to subtract from digit character
; Convert digit character to integer
;Convert ASCII digit to integer
; Combine first and second digit
; Return from function
26 prompt .STRINGZ "Input a 2 digit decimal number:
27 ASCII_OFFSET .FILL XFFD0
"
; ASCII offset to convert digit character to integer
28 LEND
22
/Users/omar/Desktop/opgave2.asm: 21:20: error: cannot encode as 5-bit 2's complement number
ADD R2, R2, #23-48
122~
Transcribed Image Text:LC3Tools ✰ 1 .ORIG x3000 opgave2.asm AND RO, RO, #0 ; Read first digit GETC OUT LD R1, ASCII_OFFSET ADD RO, RO, R1 ADD RO, RO, #-48 ADD RO, RO, RO 2 3 readS 4 LEA RO, prompt PUTS 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 RET 25 ; Read second digit GETC OUT LD R1, ASCII_OFFSET ADD R2, RO, R1 ADD R2, R2, #-48 ADD RO, RO, R2 ; Load effective address of prompt message ; Display prompt message ; Clear RO to store the result ; Read first digit ; Echo first digit ; Load ASCII offset to subtract from digit character ;Convert digit character to integer ; Convert ASCII digit to integer ; Shift to left to make room for second digit ; Read second digit ; Echo second digit ; Load ASCII offset to subtract from digit character ; Convert digit character to integer ;Convert ASCII digit to integer ; Combine first and second digit ; Return from function 26 prompt .STRINGZ "Input a 2 digit decimal number: 27 ASCII_OFFSET .FILL XFFD0 " ; ASCII offset to convert digit character to integer 28 LEND 22 /Users/omar/Desktop/opgave2.asm: 21:20: error: cannot encode as 5-bit 2's complement number ADD R2, R2, #23-48 122~
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 1 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY