Question: Assembly language please: How would I write these instructions in an LC3 compiler? Thanks. They correspond to the assignment Write an assembly program to set

Assembly language please:

How would I write these instructions in an LC3 compiler? 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."

Assembly language please: How would I write these instructions in an LC3

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

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!