Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

\"Write an LC3 machine language code fragment to count the number of even intege

ID: 3825716 • Letter: #

Question


"Write an LC3 machine language code fragment to count the number of even integers stored in a memory block Assume that The list of integers is terminated by a zero block R6 locates the start of the block"
Please help



Trace the execution of the LC-3 machine language code fragment beginning at 3100 (below) write down, in hexadecimal, the contents of the registers R1, R2. R3 and RA when the code fragment halts. Address Memory content Address Memo Content 3150 1010 1011 1100 1101 0010 0010 0101 0000 X3151 0011 0001 0101 0100 X3101 1110 0100 0101 0000 N3102 1010 0110 0101 0000 X3152: 0101 0110 0111 1000 hNo on FX3103: 0110 X3153 0011 0001 0101 0000 1000 0111 1110 ter 3104 1111 0010 0101 Tx3154: 1111 1110 1101 1100 RA [41, R3 R1 PI Write a single LC-3 mach ne language instruction for each of the following Left-shift R4 Lees 121 Test RS (Make the NZP flags describe the value stored in RS) Write an LC-3 machine language code fragment to count the number of even integers stored in a memory block. (Relevant code only. No input or output required. Assume that The list of integers is terminated by a zero word (not part of the list) R6 locates the start of the block

Explanation / Answer

0110 010 010 000000

0110 001 001 000000

R6 locates from start of the blocks , then first of the integers termineted by the zero words