The following line appears in an LC-3 assembly program: FILL x61 What is the bin
ID: 3850893 • Letter: T
Question
The following line appears in an LC-3 assembly program: FILL x61 What is the binary representation of this value (In 8 bits): _ What could this fill value represent (circle one answer)? a. the ASCH character for 'a' b. The unsigned decimal integer value 97 c. The signed decimal integer value 97 d. The of the above (that is it could be any of a. through c.) e. none of the above, this is a HEX number The code snippet below contains a flaw. Identify It. The code snippet below contains a flaw. Identify it. i R0 will contain the sum upon completion of SUM_ARRAY i R1 contains address of start of array iR2 contains number of elements in the array SUM ARRAY ST R1 SAVE_R1 ST R2 SAVE_R2 ST R3 SAVE_R3 AND R0 R0 #0 NEXT ADD R2 R2 3-1 More numbers? BRnz DONE LDR R3 R1 #0 ADD R0 R0 R3 Add the new number ADD R1 R1 #1 BRzp NEXT DONE LD R1 SAVE_R1 Restore registers LD R2 SAVE_R2 LD R3 SAVE_R3 RETExplanation / Answer
1.
x61 is a hexadecimal number notation in LC3 programming
It's binary equivalent is 01100001.
Conversion of hexadecimal to binary is as follows.
Each digit in the hexadecimal number is to be separated and converted to 4 bit binary, it is the simplest way
As here binary equivalent for 6 is 0110 and 1 is 0001.
By combining it is 01100001.
As I said earlier it is hexadecimal number, so the answer is option E.
2.
The flaw is with the instruction BRnz DONE;
In this case It should be BRz DONE;
The difference is if it is BRnz it directly goes to exit of the program w/o performing the expected task, as it is always not zero in the beginning, So it should be BRz DONE; which will do the expected task.
Please rate it if you get the answer.. Thanks...)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.