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

Can someone show me how to do this problem? (the answer is given also) I\'m new

ID: 663823 • Letter: C

Question

Can someone show me how to do this problem? (the answer is given also) I'm new to assembly language, so can you explain in detail?

4 (30 points) Fill in the values for the following registers after the program halts. Also circle the state of each flag after the program halts. Assume the initial PC is set to $100, ACCUM = 0, and XR = 0. Opcodes: LDA = 00, LDX = 01, STA = 04, ADA = 10, CMA = 20, JMP = 40, JLT = 4A ASCII: space = $20, ' = $27, A $41, I = $49, M = $4D, a = $61, d-$64, m = $6D BLKW4, $100020 ADA # PromptLen HLT @, SOFF LDX # 53 LDA $105 CMA $106 JLT $001 JMP $002 Madam I'm Adam'. PromptLen EQU .CHAR WORD $101 Madam I'm Adam', PromptLen ACCUM PC XR LT: SET CLEAROV: SET CLEAREQ: SET CLEAR

Explanation / Answer

Here PC is set to 100.

When the program execution begins PC jumps to zero. Now there are 6 instructions and for each execution the PC will increment by 1 so the value of PC will be 6.

XR will be zero as there in no operation in the instruction sequence which will effect this.

All the flags will be cleared as the only operations in the instruction sequence is jump and loads which does not effect any of the flags.