23.08.2015 Views

EECS 370 – Introduction to Computer Organization – Exam 1 w

EECS 370 – Introduction to Computer Organization – Exam 1 w

EECS 370 – Introduction to Computer Organization – Exam 1 w

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4. Memory Addressing [5 pts]Consider the following MIPS assembly program:0: lui $2, 131: addi $1, $1, -22: sh $1, 1000($0)3: lh $1, 1002($0)4: sw $2, 1000($0)Recall that register $0 always contains the value zero and that MIPS is big-endian. Fill in thefollowing tables in hexadecimal, based on the instruction sequence above. When a register ormemory location does not change, write a dash (--) in the corresponding space of the table.The initial value for register $1 is 0xABCDEF01 and for register $2 is 0x00001000.Register After inst 0 After inst 1 After inst 2 After inst 3 After inst 4$1 -- 0xABCDEEFF -- 0xFFFFBEEF --$2 0x000D0000 -- -- -- --MemoryAddressInitialValueAfter inst 0 After inst 1 After inst 2 After inst 3 After inst 41000 0xDE -- -- 0xEE -- 0x001001 0xAD -- -- 0xFF -- 0x0D1002 0xBE -- -- -- -- 0x001003 0xEF -- -- -- -- 0x00Page 4 of 12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!