Question: Opcodes Instruction Opcode Instruction Opcode Instruction Opcode ADD 00000000 OR 00000100 Bcc 00001000 SUB 00000001 MOV 00000101 HLT 00001001 NOT 00000010 LD 00000110 AND 00000011

Opcodes Instruction Opcode Instruction Opcode Instruction Opcode ADD 00000000 OR 00000100 Bcc 00001000 SUB 00000001 MOV 00000101 HLT 00001001 NOT 00000010 LD 00000110 AND 00000011 ST 00000111

Part II: Hand Assemble Translate the following program into hexadecimal form, and put it in a file named prog2 with the same format as the le prog. Run the simulator by [python3] sim.py [-d] prog2 Write down the nal result stored in P. What does the program do?

LD P0, R4 LD P1, R1 LD P2, R2 LD P3, R3 L: ADD R4, R2, R4 SUB R3, R1, R3 BNZ L ST R4, P HLT P0: .WORD 0 P1: .WORD 1 P2: .WORD 5 P3: .WORD 4 P: .WORD A working simulator (executable pyc le only, without source code) is given to you, so that you can complete this part using this program, if your simulator in Part I is not working.

I want to know --> Write down the nal result stored in P. What does the program do?

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!