EE 308

Homework Assignment 4
Due Feb. 16, 2000

  1. Find the values of the N, C, Z, and V bits of the CCR register after execution of each of the following instructions, given that [A] = 0xA0 and the condition flags are N=0, C=1, Z=1, and V=0. (Assume these are the values before each instruction starts -- e.g., do not use the flag state resulting from the instruction in part (a) as the initial state for part (b).)
    1. TSTA
    2. ADDA #$67
    3. LSLA
    4. CMPA #$60
    5. SUBA #$70
    6. RORA

  2. The following is the output from a program assembled using the CA6812 assembler. In a few cases the assembler output has been replaced by blanks. Fill in the blanks to show what the assembler output really was.
       1                     ; Example program for Homework 4
       2                     
       3       00000800      prog:    equ     $0800
       4       ________      data:    equ     $0000
       5                     
       6                     
       7       00000004      LEN:    equ     $04
       8                     
       9                     
      10                     CODE:   section .text   
      11  0800                       org     prog
      12  0800 de01          start:  ldx     val2
      13  ____ cc3344                ldd     #$3344
      14  0805 52                    ____    
      15  0806 6b__                  stab    LEN,x
      16  0808 9603                  ldaa    val2+2
      17  080a 5a04                  staa    _____
      18  080c ______                inc     count
      19  080f 3f            last:   swi
      20                     
      21                     
      22                     DATA:   section .data    
      11  0000                       org     data
      23  0000 0a            val1:   dc.b    10
      24  0001 c200          val2:   dc.w    $c200
      25  ____ f0                    dc.b    ____
      26  0004 00000000      table:  ds.b    LEN
      27  0008 __            count:  dc.b    -10
    
    
    
    Map of junk.h12 from link file hw04.lkf - Fri Feb 04 16:29:50 2000
    
    LEN     00000004  
    count   00000008  
    data    00000000  
    ____    0000080f  
    prog    00000800  
    start   ________  
    table   00000004  
    val1    00000000  
    val2    00000001  
    
    

  3. Write a sequence of instructions which will make bits 3-0 of PORT B input and bits 7-4 of PORT B output. These instructions should be in assembly language.


  4. Write the program for Lab 4. Make sure you use top-down design, and document your program with comments. This program should be in assembly language.


Bill Rison, <rison@ee.nmt.edu >