Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assembly Language: How would I write these instructions in an LC3 editor? Thanks. They correspond to the assignment Write an assembly program to set R0=1

Assembly Language:

How would I write these instructions in an LC3 editor? Thanks. They correspond to the assignment "Write an assembly program to set R0=1 if there's a 5 in one of ten memory locations, starting at x3100. At the beginning of the program, set R0 = 0. If no 5 is found, it should leave R0 set to 0. If a 5 is found, output the following message to the console. "A 5 was found at x31xx." 31xx is the hex address of the 5."

image text in transcribed

Address Contents x3100 9 x3101 7 x3102 32 x3103 0 x3104 -8 X3105 19 x3106 6 x3107 13 x3108 5 x3109 61 Put a breakpoint at x300D to see how many times we branch back. PC RO R2 R3 R4 x300D 1 7 9 x3101 x300D 1 32 8 x3102 x300D 1 0 7 X3103 0 0 7 x3103 -Didn't branch back, eventhough R3 > 0? Branch uses condition code set by loading R2 with M[R4], not by decrementing R3. Swap x300B and x300C, or remove x300C and branch back to x3007. Address Contents x3100 9 x3101 7 x3102 32 x3103 0 x3104 -8 X3105 19 x3106 6 x3107 13 x3108 5 x3109 61 Put a breakpoint at x300D to see how many times we branch back. PC RO R2 R3 R4 x300D 1 7 9 x3101 x300D 1 32 8 x3102 x300D 1 0 7 X3103 0 0 7 x3103 -Didn't branch back, eventhough R3 > 0? Branch uses condition code set by loading R2 with M[R4], not by decrementing R3. Swap x300B and x300C, or remove x300C and branch back to x3007

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