Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to make a program that does the following: Write a machine language program for the LC 3 . It should print out your

I need to make a program that does the following:
Write a machine language program for the LC3. It should print out your name forward
and backward. You need to only print 6 letters of your first or last name. Your program
should NOT require user input into memory or registers. To get full credit, you must use a
loop to print the letters. Capitalize the first letter. If.
Here is the code I have thus far. It currently will print P at the end repeatedly, but everything else works.
0011000000000000 ; Start at x3000
0101001001100000 ; Set a counter(R1) to zero x3001
0010011000100011 ; Set the max (R3) value to 2 x3003
0010000000100011 ; LD R0<-'P' x3004
1111000000100001 ; Trap x21- Print letter 'P' x3005
0010000000100010 ; LD R0<-'h' x3006
1111000000100001 ; Trap x21- Print letter 'h' x3007
0010000000100001 ; LD R0<-'a' x3008
1111000000100001 ; Trap x21- Print letter 'a' x3009
0010000000100000 ; LD R0<-'m' x300A
1111000000100001 ; Trap x21- Print letter 'm' x300B
0010000000011111 ; LD R0<-'s' x300C
1111000000100001 ; Trap x21- Print letter 's' x300D
0010000000011110 ; LD R0<-'a' x300E
1111000000100001 ; Trap x21- Print letter 'a' x300F
0010000000011101 ; LD R0<-'g' x3010
1111000000100001 ; Trap x21- Print letter 'g' x3011
0010000000011100 ; LD R0<-'e' x3012
1111000000100001 ; Trap x21- Print letter 'e' x3013
0010000000011010 ; LD R0<-'e' x3014
1111000000100001 ; Trap x21- Print letter 'e' x3015
0010000000010111 ; LD R0<-'g' x3016
1111000000100001 ; Trap x21- Print letter 'g' x3017
0010000000010100 ; LD R0<-'a' x3018
1111000000100001 ; Trap x21- Print letter 'a' x3019
0010000000010001 ; LD R0<-'s' x301A
1111000000100001 ; Trap x21- Print letter 's' x301B
0010000000001110 ; LD R0<-'m' x301C
1111000000100001 ; Trap x21- Print letter 'm' x301D
0010000000001011 ; LD R0<-'a' x301E
1111000000100001 ; Trap x21- Print letter 'a' x301F
0010000000001000 ; LD R0<-'h' x3020
1111000000100001 ; Trap x21- Print letter 'h' x3021
0010000000000101 ; LD R0<-'P' x3022
1111000000100001 ; Trap x21- Print letter 'P' x3023
0001001001100001 ; Decrement counter by 1 x3024
0000111111111011 ; Go back to checking x3025
1111000000100101 ; Stop x3026
0000000000000010 ; 2= x2 x3027
0000000001010000 ; Letter 'P'= x50 x3028
0000000001101000 ; Letter 'h'= x68 x3029
0000000001100001 ; Letter 'a'= x61 x302A
0000000001101101 ; Letter 'm'= x6D x302B
0000000001110011 ; Letter 's'= x73 x302C
0000000001100001 ; Letter 'a'= x61 x302D
0000000001100111 ; Letter 'g'= x67 x302E
0000000001100101 ; Letter 'e'= x65 x302F

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Were multiple treatments used? Did they interfere with each other?

Answered: 1 week ago

Question

What would you do?

Answered: 1 week ago