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

1) MARIE is a minimalist accumulator architecture that is fully functional. Ther

ID: 3794626 • Letter: 1

Question

1) MARIE is a minimalist accumulator architecture that is fully functional. Therefore, it is important to be familiar with it. Name all the registers in MARIE and describe the purpose of each of them.

2) Hand assemble the following program in two passes using the table of MARIE’s opcodes. (remember to convert the opcodes to hexadecimal). Show the values stored in the symbol table.

Address Assembly code Machine code Pass 1 Pass 2 Load Store JnS Store Load Store JnS Store Halt Dec Dec Dec Hex Load Add JumpI End /load the first number to be doubled /Use Temp as a parameter to pass value to Subr /Store return address, jump to procedure /Store first number, doubled /Load the second number to be doubled 001 002 003 004 005 006 007 008 009 00A 00B 00C 00D 00E O0F Temp Subr Temp/Use Temp as a parameter to pass value to Subr Subr /Store return address, jump to procedure /Store second number, doubled /End program 20 48 Temp, Subr. /Store return address here Temp Temp Subr /Subroutine to double numbers

Explanation / Answer

def foo(): n,m=map(int,raw_input().split()) a=[] for i in range(n): a.append(map(int,raw_input().split())) for i in range(m): for j in range(i+1, n): # ensure j > i a[i][j],a[j][i]=a[j][i],a[i][j] for i in a: #printing transpose print i