

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Student Name:______________________________ Student ID: _______________
Show work with intermediate steps. Showing only the answer will get no credit.
Problem 1 – 30 points Assume “ pshd” is the next instruction in line and is executed with the initial values shown in the table below.
a – Fill in all blank entries in the table before and after the execution of the instruction.
Initial Value (before execution) Final Value (After execution) Accumulator A $ Accumulator B $ Accumulator D Accumulator X $ Stack Pointer (SP) $ Accumulator Y $ Bit N of CCR 0 Bit Z of CCR 0 Bit C of CCR 0 Bit V of CCR 0 Memory $1000 $ Memory $1001 $ Memory $1002 $FF Memory $1003 $FE Memory $1004 $FC Memory $1005 $FE Memory $1006 $FD
b - Give one reason (10 words or less) why someone would use this instruction.
Student Name:______________________________ Student ID: _______________
Problem 2 30 points – a) Provide the machine code (hand assemble) the instruction std [$1000,X] followed by an inca instruction (15pts ) by filling out the table below. Assume the instruction starts at location $1000. (Note: not all locations below may be necessary in which case leave them blank).
Address Contents $ $ $ $ $ $ $ $ $
b) Given the contents of eeprom below and assuming the contents are instructions, create (hand dis-assemble) the corresponding assembly program (15pts). Hint: more than one instruction is encoded below. Boundaries are important. The instructions are contrived so don’t look for them to do something reasonable.
Address Contents $0C00 $ $0C01 $EE $0C02 $EF