
1.2. TASKS 13
(b) Find out the ascii codes for the letters in the phrase THIS CLASS IS
FUN. To get you started, here are some codes: code for ’T’ is 54, code
for ’H’ is 48 and code for I is 49.
(c) Enter the ASCII codes starting from location D200. After you enter
the last ASCII code, enter the special code 04.
(d) Run the program and write down what output you get.
(e) To see why you need the special code, do memory modify and change
it to 0A. Rerun the program and write down what you observe.
1.2.7 Entering your program: Using assembler
In this method, we will do all the work on the PC and eventually transfer the
program to HC11. Start any text editor. DO NOT USE A WORDPRO-
CESSOR such as Word, Wordpad etc. The best editor I am aware of the Pro-
grammer’s file editor (PFE). This editor is part of the lab package that you can
download from the web. Create a directory/folder where you will do all your work.
In that directory, copy all the files from the lab pack.
Using the editor, create a file called PROG1.ASM and enter the following
5
:
*Name: your name goes here
*Uniqname: Your unique name goes here
*Class: ECE 373 (or your course number)
*Term: The term
*Date: Date you started the code
ORG $C000 *this determines where the code will be stored
LDAA $D000
ADDA $D001
ADDA $D002
STAA $D003
SWI
Save your file. Start a MSDOS. Change directory to where your files are stored.
Execute the command
ASM PROG1
If there are no errors, you should see two new files, PROG1.LST and PROG1.S19.
The first file for humans to read and is often called the LST file and the second
is for the HC11 and is called the S19 file.
Go back to the BUFFALO prompt and type the command
5
By tradition, assembly language programs are written in UPPERCASE letters, except if
you are writing code for Unix and its derivatives.
Komentáře k této Příručce