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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!