Question
LC3 lower case to uppercase. The program is supposed to take a person's initials and output them as uppercase. Is it possible to get the
LC3 lower case to uppercase. The program is supposed to take a person's initials and output them as uppercase. Is it possible to get the program to look like this:
Type your first, middle, and last initial in lowercase> abc
The first initial is> A
The first initial is> B
The first initial is> C
(What I have so far)
.ORIG x3000
LEA R0,PROMPT1 ; Displays first prompt.
PUTS
GETC ; Reads char
OUT ; Output a character to the monitor
ST R0,CHAR ; Safe keeps char.
LD R0,CRLF ; Executes new line.
OUT ; Writes char
LEA R0,PROMPT2 ; Displays second prompt.
PUTS
LD R0,CHAR ; Reload char
LD R1,NEG32
ADD R0,R0,R1
OUT ; Displays uppercase.
GETC ; Reads char
ST R0,CHAR ; Safe keeps char.
LD R0,CRLF ; Executes new line.
OUT ; Writes char
LEA R0,PROMPT3 ; Displays second prompt.
PUTS
LD R0,CHAR ; Reload char
LD R1,NEG32
ADD R0,R0,R1
OUT ; Displays uppercase.
GETC ; Reads char
ST R0,CHAR ; Safe keeps char.
LD R0,CRLF ; Executes new line.
OUT ; Writes char
LEA R0,PROMPT4 ; Displays second prompt.
PUTS
LD R0,CHAR ; Reload char
LD R1,NEG32
ADD R0,R0,R1
OUT ; Displays uppercase.
HALT
;************ Data area*******************************
PROMPT1 .STRINGZ "Type your first, middle, and last initial in lowercase> "
PROMPT2 .STRINGZ "The first initial is> "
PROMPT3 .STRINGZ "The middle initial is> "
PROMPT4 .STRINGZ "The last initial is> "
CHAR .BLKW 3
NEG32 .FILL #-32
CRLF .FILL #10
.END
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started