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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

a) [1 points] Is this a RISC or CISC architecture? Circle your response.RISCCISCb) [3 points] Translate the following assembly instructions in<strong>to</strong> machine code.Assembly Instructionload -14add.acc1bgz 17Machine Code (hex)0b1111 1111 0010 0110 = 0xFF260b0000 0000 0000 1011 = 0x000B0b0000 0001 0001 0100 = 0x0114c) [10 points] Translate the following C instruction in<strong>to</strong> assembly instructions. Assume that ais s<strong>to</strong>red at memory address 4, b at address 8 and the result should be s<strong>to</strong>red at address 12.Both accumula<strong>to</strong>rs are initialized at 0. Make sure branch offsets are specified as integervalues, not labels. Use the table below for your code. You may not need <strong>to</strong> use all the rowsavailable.if (b >12) result = a;Retrieve b from memoryload 8Compare b <strong>to</strong> 12mov2pushi 12mov1neg.acc2add.acc1//acc1 is 12-bEvaluate if conditionbgz 4Set result <strong>to</strong> aload 4s<strong>to</strong>re 12Page 12 of 12

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

Saved successfully!

Ooh no, something went wrong!