|
ECEN 3213 Fall 2001 Exam 2 8 November 2001 |
Name__________SOLUTION___________ |
The questions in this exam refer to the 68HC11A8 single chip, unless otherwise noted in the question. Read the instructions carefully before completing the exam. All answers must be shown on these pages – no attached pages will be graded.
Consider the assembly program listing on the last page of this exam.
|
Addressing mode |
Example instruction |
Address of example instruction |
Location of operand for example instruction |
|
Inherent |
inx |
$F011 |
X Register |
|
Immediate |
ldaa #$00 |
$F005 |
Memory location $F006 |
|
Direct |
staa count |
$F00A |
mem location $0001 |
|
Extended |
ldab DataIn |
$F00C |
memory location $100A |
|
Indexed |
stab storedvalues,x |
$F015 |
Register B |
Consider the Block Diagram for the 68HC11A8 on page 24 of Valvano and the assembly program listing on the last page of this exam.
The following questions all refer to the program assembly listing on the last page.
The following multiple-choice questions all concern the assembly listing on the next page and will be scored as 3 pts for each correct answer, -1 for an incorrect answer and 0 for unanswered questions.
Consider the instruction starting at address $F005.
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
18 . What part of the machine code represents the OP Code, or operator?__a___
a. $86 b. $F5 c. $8600 d. $8E e. $00 f $8E00 g. None of these choices
a. $86 b. $F5 c. $00F5 d. $8E e. $00 f $8E00 g. None of these choices
20. (14 pts) Complete the following RAM memory Map for the Assembly listing on the last page. (There are more blanks than answers, put an XXX in unused spaces, which could help with question 11).
|
RAM Memory Address |
Name |
Size (number of Bytes) |
|
$00 |
XXX |
1 byte |
|
$01 |
count |
1 byte |
|
$02 |
key |
1 byte |
|
$03 |
temp |
1 byte |
|
$04 thru $73 |
XXX |
112 bytes unused |
|
|
|
|
|
$74 to $D7 ($64 if next note) |
storedvalues |
100 bytes for storing values |
|
(note: need this line if $64 for storedvalues) $74 to $D7 |
|
100 bytes for storing values |
|
|
|
|
|
$D8 thru $FF |
XXX |
40 bytes unused |
|
|
|
|
|
|
|
|
|
$FF |
XXX |
|
$0001 count equ $0001
$0064 storedvalues equ $0064
$0003 temp equ 3
$0002 key equ $0002
$1000 PortA equ $1000
$1004 DataOut equ $1004
$100A DataIn equ
$100A
$F001 org $F001
$F001 Þ8677 [ 2]( 0){pp }start ldaa #$77
$F003 9702 [ 3](
2){ppw } staa key
$F005 8600 [ 2](
5){pp } ldaa
#$00
$F007
CE000F [ 3]( 7){ppp } ldx
#$000F
$F00A 9701 [ 3]( 10){ppw } staa count
$F00C F6100A [
4]( 13){pppr }begin ldab DataIn
;Load clear data
$F00F D703 [ 3]( 17){ppw } stab temp
$F011 08 [ 3]( 20){pfn } inx
$F012 4C [ 2]( 23){pf } inca
; increment count of number of values read.
$F013 9701 [ 3]( 25){ppw } staa count
$F015 E764 [ 4]( 28){ppnw } stab storedvalues,x
$F017 D802 [ 3]( 32){ppr } eorb key ; encrypt
data with key
$F019 F71004 [
4]( 35){pppw } stab DataOut ; output
encrypted data
$F01C 9601 [ 3]( 39){ppr } ldaa count
$F01E 8164 [ 2]( 42){pf } cmpa #100 ;
check for count hitting 100.
$F020 25EA [ 3]( 44){pfn } blo
begin
$F022 CF [ 2]( 47){pf } stop ; count hit 100, all done.
$FFFE org $FFFE
$FFFE F001 dc.w start
$0000 end
***************Symbol
Table*********************
DataIn $100A
DataOut $1004
PortA $1000
begin $F00C
count $0001
key $0002
start $F001
storedvalues
$0064
temp $0003
Assembly
successful