Docsity

Embedded Systems Exam 1 - Spring 2007 - Problem Solutions, Exams of Microprocessors

Toggle sidebar
bg1
EE3376 – Embedded Systems - Spring 2007 - Exam 1 – MacDonald – Page 1
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 $12
Accumulator B $34
Accumulator D
Accumulator X $1000
Stack Pointer (SP) $1004
Accumulator Y $1002
Bit N of CCR 0
Bit Z of CCR
0
Bit C of CCR 0
Bit V of CCR 0
Memory $1000 $80
Memory $1001 $00
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.
pf3

Partial preview of the text

Download Embedded Systems Exam 1 - Spring 2007 - Problem Solutions and more Exams Microprocessors in PDF only on Docsity!

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