c109sp01t1 - CSc 109 Test 1 Wednesday 28 October 2001 Open...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 109 Test 1 Wednesday 28 October 2001 Open book, open notes. No calculators, or computers allowed. Suggested answers. 1. (xx pts) Given the sm program below, fill out the table to its right, for the first 11 instructions when the program executes, unless the program halts or crashes before then. It will be more convenient to use hex numbers to indicate the contents of the stack before the instruction is executed. 0 0xB01 Step PC Instruction Stack (top to right) 1 0x300 1 0 B01 0 0 0 0 2 0x30D 3 0x500 2 ___1______300___________0_____0____0_____0__ 4 0x400 5 0xB00 3 ___2______30D___________0_____0____0____BO1_ 6 0x300 7 0x30D 4 ___3______500___________0_____0__BO1______5_ 8 0x500 9 0x400 5 ___4______400___________0_____0____0____B06_ 10 0xB00 11 0x400 6 ___5______B00___________0_____0____0______0_ 12 0xB 13 0x5 7 ___0______B06___________0_____0____0______0_ 8 ___6______300___________0_____0____0______0_ 9 ___7______30D___________0_____0____0____B06_ 10 ___8______500___________0_____0__B06______5_ 11 ___9______400___________0_____0____0____B0B_ 2. (xx pts) Write an sasm program which reads in two numbers and then writes out the remainder when the first is divided by the second. So you can write the complete file, assume you test the program with
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/09/2008 for the course CSE 109 taught by Professor Kay during the Spring '08 term at Lehigh University .

Page1 / 4

c109sp01t1 - CSc 109 Test 1 Wednesday 28 October 2001 Open...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online