ADDR B1 B2 B3 B4 X:\public_html\EEL4746\programs\Hello World\ PAGE 1
* Popular equates
EXT_RAM_START EQU $0200 * Start of external RAM in U5
BUF_UTLJMP_START EQU $ffa0 * Start of Buffalo utility
. subroutine jump table in ROM
JUMPINST_SIZE EQU 3 * Length of jump opcode + 2
. byte addr
EOT EQU $04 * ASCII code for "end of
. transmission"
* Define the entries in the Buffalo utility jump table
ORG BUF_UTLJMP_START
UPCASE RMB JUMPINST_SIZE * Convert character to
. uppercase
WCHEK RMB JUMPINST_SIZE * Test character for
. whitespace
DCHEK RMB JUMPINST_SIZE * Check character for
. delimiter
INIT RMB JUMPINST_SIZE * Initialize I/O device
INPUT RMB JUMPINST_SIZE * Read I/O device
OUTPUT RMB JUMPINST_SIZE * Write I/O device
OUTLHLF RMB JUMPINST_SIZE * Convert left nibble to
. ASCII and output
OUTRHLF RMB JUMPINST_SIZE * Convert right nibble to
. ASCII and output
OUTA RMB JUMPINST_SIZE * Output ASCII character
OUT1BYT RMB JUMPINST_SIZE * Convert binary byte to 2
. ASCII characters and output
OUT1BSP RMB JUMPINST_SIZE * Convert binary byte to 2
. ASCII characters and output followed by space
OUT2BSP RMB JUMPINST_SIZE * Convert 2 consecutive
. binary bytes to 4 ASCII characters and output followed by
. space
OUTCRLF RMB JUMPINST_SIZE * Output ASCII carriage
. return followed by line feed
OUTSTRG RMB JUMPINST_SIZE * Output ASCII string until
. end of transmission (004)
OUTSTRG0 RMB JUMPINST_SIZE * Same as OUTSTRG except
. leading carriage return and line feed is skipped
INCHAR RMB JUMPINST_SIZE * Input ASCII character and
. echo back
* Here's our actual program.
ORG EXT_RAM_START * Start code at beginning of
. external RAM
* "Hello" subroutine, prints "Hello World!" on Serial Comm.
. Interface.
0200 CE 02 07 HELLO: LDX #MSG * Point X at "Hello World!"
. string
0203 BD FF CA JSR OUTSTRG0 * Call appropriate "Out
. String" subroutine to print
0206 39 RTS * Return from subroutine
0207 48 65 6C 6C MSG: FCC 'Hello World!'
. 020B 6F 20 57 6F
. 020F 72 36 64 21
0213 04 FCB EOT
Symbol Table
INCHAR FFCD
Symbol Table X:\public_html\EEL4746\programs\Hello World\ PAGE 2
OUTA FFB8
HELLO 0200
INIT FFA9
OUTLHLF FFB2
UPCASE FFA0
OUTRHLF FFB5
DCHEK FFA6
OUTCRLF FFC4
JUMPINST_SIZE 0003
MSG 0207
BUF_UTLJMP_START FFA0
OUT1BSP FFBE
WCHEK FFA3
OUTSTRG0 FFCA
EOT 0004
OUTSTRG FFC7
EXT_RAM_START 0200
INPUT FFAC
OUT2BSP FFC1
OUT1BYT FFBB
OUTPUT FFAF