Docsity

Microcomputers Quiz 2 Solutions for ECE 383 Spring 2010 - Prof. Qi Hao, Quizzes of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 383 - Microcomputers
Spring 2010 โ€“ Quiz 2 Solution
Problems:
1. What is the value of register or memory after each instruction โ€ฆ
a. LDD #$1112 ; D = $1112
b. TFR D, X ; X = $1112
c. STD 0, X ; $1112 -- $11 $1113 -- $12
d. LDAA 1, +X ; A = $12
e. LDAB 1, โˆ’X ; B = $11
f. STD 0, X ; D = $1211
$1112 -- $12 $1113 -- $11
2. What is the value of registers after each instruction given the initial values of memories and register Y?
ORG $1010
STR DC.B $10, $11, $10, $11 ; (SP = $3C00)
a. LDY #STR ; Y = $1010
b. LDAA 2, +Y ; A = $10 Y = $1012
c. LDAA 1, Yโˆ’ ; A = $10 Y = $1011
d. LDD STR+1 ; D = $1110
e. LDY #STR+1 ; Y = $1011
f. PSHD ; SP= $3BFE $3BFF = $10
g. PSHY ; SP= $3BFC $3BFD = $11
h. PULD ; SP= $3BFE D = $1011
3. What are the values of registers after each instruction given their initial values?
(1) PC = $2200, REG = %01100000 (2) PC = $2400, REG = %00110000
BRSET REG, #%10100000, * BRCLR REG, #%10000001, *
PC = $2205 PC = $2400
(3) PC = $2300, Y = 5, CCR_Z = 0 (4) PC = $2500, Y = 1, CCR_Z = 0
DBNE Y, * DBNE Y, *
PC = $2300 Y = 4 CCR_Z = 0 PC = $2503 Y = 0 CCR_Z=1
(5) A = %10110001 (5) A = %10110001
LSRA ASLA
A = %01011000 A = %01100011

Partial preview of the text

Download Microcomputers Quiz 2 Solutions for ECE 383 Spring 2010 - Prof. Qi Hao and more Quizzes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 383 - Microcomputers

Spring 2010 โ€“ Quiz 2 Solution

Problems:

  1. What is the value of register or memory after each instruction โ€ฆ a. LDD #$1112 ; D = $ b. TFR D, X ; X = $ c. STD 0, X ; $1112 -- $11 $1113 -- $ d. LDAA 1, +X ; A = $ e. LDAB 1, โˆ’X ; B = $ f. STD 0, X ; D = $ $1112 -- $12 $1113 -- $
  2. What is the value of registers after each instruction given the initial values of memories and register Y? ORG $ STR DC.B $10, $11, $10, $11 ; (SP = $3C00)

a. LDY #STR ; Y = $ b. LDAA 2, +Y ; A = $10 Y = $ c. LDAA 1, Yโˆ’ ; A = $10 Y = $ d. LDD STR+1 ; D = $ e. LDY #STR+1 ; Y = $ f. PSHD ; SP= $3BFE $3BFF = $ g. PSHY ; SP= $3BFC $3BFD = $ h. PULD ; SP= $3BFE D = $

  1. What are the values of registers after each instruction given their initial values?

(1) PC = $2200, REG = %01100000 (2) PC = $2400, REG = %

BRSET REG, #%10100000, * BRCLR REG, #%10000001, *

PC = $2205 PC = $

(3) PC = $2300, Y = 5, CCR_Z = 0 (4) PC = $2500, Y = 1, CCR_Z = 0

DBNE Y, * DBNE Y, *

PC = $2300 Y = 4 CCR_Z = 0 PC = $2503 Y = 0 CCR_Z=

(5) A = %10110001 (5) A = %

LSRA ASLA

A = %01011000 A = %