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. 

  1. (15pts) For each of the addressing modes: give an example instruction, its address from the assembly listing, and the location of the operand:

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.

  1. (4pts) How many input ports of 68HC11A8 does the program use?__1___
  2. (4pts) How many output ports of 68HC11A8 does the program NOT use?__0__
  3. (4pts) How many bi-directional ports of 68HC11A8 does the program use? 1 or 0
  4. (4pts) How many input pins of 68HC11A8 does the program NOT use?_3 or 5_
  5. (4pts) How many output pins of 68HC11A8 does the program NOT use?__4__
  6. (4pts) How many bi-directional pins of 68HC11A8 does the program use? 0 or 1

The following questions all refer to the program assembly listing on the last page.

  1. (5pts) How long is the program in bytes (decimal number)?__34__
  2. (5pts) How long is the program in bytes (Hex number)?__22__
  3. (5pts) How much of the 256 bytes of RAM is UNUSED by the program?153 bytes
  4. (5pt) What is the latency to process one byte of input?__39 or 26 cycles___
  5. (6pts) What is the address range of instructions to calculate the latency?  First_$F001 or $F00C___    and Last__$F019___
  6. (6pts) What is the address range of instructions to calculate the throughput?  First__$F00C__    and Last__$F020___

 

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.

  1. How many cycles does it take to fetch the operand of the instruction?__b__

        a. 0       b. 1         c. 2      d. 3       e. 4        f. 8         g. None of these choices

  1. How many cycles does it take to complete the instruction?__c__

        a. 0       b. 1         c. 2      d. 3       e. 4        f. 8         g. None of these choices

  1. How many cycles does it take to fetch the operator of the instruction?__b__

        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

  1. What part of the machine code represents the operand?__e___

        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