Consider the following program in MARIE assembly language. a) Complete the table detailing the RTN for next 2 instructions only that will be executed including the content of registers PC, IR, MAR,...


Consider the following program in MARIE assembly language. a) Complete the table detailing

the RTN for next 2 instructions only that will be executed including the content of registers PC,

IR, MAR, MBR and AC in hexadecimal. Note the first instruction LOAD X is already filled. Note

also that SKIPCOND instruction has no operands, therefore you can complete Fetch, decode and

execute cycles only. b) Explain in one statement the task performed by this program?


Instruction<br>Step<br>RTN<br>PC<br>IR<br>MAR<br>MBR<br>AC<br>MAR - PС<br>000<br>0000<br>000<br>0000<br>0000<br>Fetch<br>IR + M[MAR]<br>000<br>1007<br>000<br>0000<br>0000<br>РC + PC +1<br>001<br>1007<br>000<br>0000<br>0000<br>Decode OPCODE<br>IR[15-12]=0001<br>001<br>1007<br>000<br>0000<br>0000<br>Load X<br>Decode<br>=> Load<br>MAR + IR[11-0]<br>001<br>1007<br>007<br>0000<br>0000<br>Get<br>MBR + M[MAR]<br>001<br>1007<br>007<br>000A<br>0000<br>operand<br>execute<br>AC + MAR<br>001<br>1007<br>007<br>000A<br>000A<br>

Extracted text: Instruction Step RTN PC IR MAR MBR AC MAR - PС 000 0000 000 0000 0000 Fetch IR + M[MAR] 000 1007 000 0000 0000 РC + PC +1 001 1007 000 0000 0000 Decode OPCODE IR[15-12]=0001 001 1007 000 0000 0000 Load X Decode => Load MAR + IR[11-0] 001 1007 007 0000 0000 Get MBR + M[MAR] 001 1007 007 000A 0000 operand execute AC + MAR 001 1007 007 000A 000A
2. Consider the following program in MARIE assembly language. a) Complete the table detailing<br>the RTN for next 2 instructions only that will be executed including the content of registers PC,<br>IR, MAR, MBR and AC in hexadecimal. Note the first instruction LOAD X is already filled. Note<br>also that SKIPCOND instruction has no operands, therefore you can complete Fetch, decode and<br>execute cycles only. b) Explain in one statement the task performed by this program?<br>LOAD X<br>/ AC = X<br>Repeat, SKIPCOND 800<br>JUMP End<br>/ if AC > 0 then PC = PC + 1 (skip)<br>/ Go to End<br>SUBT One<br>/ AC = ÁC - 1<br>STORE X<br>= AC<br>JUMP Repeat<br>| Go to Repeat<br>STORE X<br>End,<br>HALT<br>/ Stop (end of program)<br>X,<br>One,<br>DEC 10<br>DEC 1<br>label<br>opcode<br>|operand<br>hex<br>1007<br>AC<br>0000<br>...<br>OUTPUT<br>000<br>LOAD<br>O 001<br>Repeat<br>SKIPCOND 800<br>8800<br>O 002<br>JUMP<br>End<br>9006<br>IR<br>0000<br>003<br>SUBT<br>One<br>4008<br>004<br>JUMP<br>Repeat<br>9001<br>MAR<br>000<br>O 005<br>STORE<br>X<br>2007<br>O 006<br>End<br>HALT<br>7000<br>MBR<br>0000<br>O 007<br>DEC<br>10<br>000A<br>008<br>One<br>DEC<br>1<br>0001<br>PC<br>000<br>Control<br>INP..<br>+0+<br>+1<br>+2<br>+3<br>+4<br>+5<br>+6<br>+7<br>+8<br>+9<br>+A<br>+B<br>+C<br>+D<br>+E<br>+F<br>000 1007 8800 9006 4008 9001 2007 7000 000A 0001 0000 0000<br>010 0000 0000 0000 0000 0000 0000 0000 0000 0000 000<br>020 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>0000 0000 0000 0000 0000<br>0000<br>0000 0000 0000 0000 0000<br>0000<br>0000<br>0000<br>030 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>050 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>070 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>0000 0000 0000 0000<br>080 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000<br>

Extracted text: 2. Consider the following program in MARIE assembly language. a) Complete the table detailing the RTN for next 2 instructions only that will be executed including the content of registers PC, IR, MAR, MBR and AC in hexadecimal. Note the first instruction LOAD X is already filled. Note also that SKIPCOND instruction has no operands, therefore you can complete Fetch, decode and execute cycles only. b) Explain in one statement the task performed by this program? LOAD X / AC = X Repeat, SKIPCOND 800 JUMP End / if AC > 0 then PC = PC + 1 (skip) / Go to End SUBT One / AC = ÁC - 1 STORE X = AC JUMP Repeat | Go to Repeat STORE X End, HALT / Stop (end of program) X, One, DEC 10 DEC 1 label opcode |operand hex 1007 AC 0000 ... OUTPUT 000 LOAD O 001 Repeat SKIPCOND 800 8800 O 002 JUMP End 9006 IR 0000 003 SUBT One 4008 004 JUMP Repeat 9001 MAR 000 O 005 STORE X 2007 O 006 End HALT 7000 MBR 0000 O 007 DEC 10 000A 008 One DEC 1 0001 PC 000 Control INP.. +0+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F 000 1007 8800 9006 4008 9001 2007 7000 000A 0001 0000 0000 010 0000 0000 0000 0000 0000 0000 0000 0000 0000 000 020 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 030 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 050 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 070 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 080 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here