ECE 373: MINI LAB 1

What is a mini lab?

A mini lab is essentially a programming exercise using HC11. Unlike a formal lab where you are expected to write a lab report, you only have to provide the listing file and the output. Most mini-labs will be closely related to a formal lab or will relate to lecture material that may not be adequately covered in a formal lab.
 

Topic: Looping

  1. Write an HC11 program that will add the sixteen numbers stored in consecutive locations $3100-$310F and store the result in the 16-bit location $3010-$3011.  The output of your program should be the sixteen numbers in locations $3100-$310F, followed by the string ">>" and then the value in $3010-$3011.
  2. Write an HC11 program that will copy a block of data starting at location $3C00 to a corresponding block starting at location $3D00. The number of bytes to be copied is not specified initially. However, you are told that the last number in the block to be moved is $04. Populate the source block (starting at location $3C00) with a string terminated by the magic number $04. The output of the program should be the source string and the destination string. Note the BUFFALO routine OUTSTRG will print the string and it knows to stop when it sees a $04 (hint hint).
  3. Write an HC11 program that will compare the block of data stored in locations $3000 to $300F with the corresponding numbers stored in locations $3100 to $310F. If all the sixteen corresponding numbers match, your program should print SAME. Otherwise it should print DIFFERENT.

Notes:

The following assembly language code will set up a string suitably terminated with $04.
STRING1    FCC  'Now is the time for all good men to come to the aid of the party'
           FCB   $04
The above string can be printed using the outstrg function
            LDX #STRING1
            JSR OUTSTRG
OUTSTRG is a BUFFALO routine which should be equated to:
OUTSTRG    EQU    $FFC7

This gives the label OUTSTRG a memory location of $FFC7, where BUFFALO has stored the code for the built-in function, outstrg.