'Hola! El Paso' Program:
;**************************************************************** ;* ;* UTEP EE3376 ;* ;* Simple program to write the string: ;* ;* ---- ;* Hola! El Paso ;* ---- ;* ;* to the CRT using a D-Bug12 routine on an HC12/HCS12 board connected ;* via Hyperterminal. ;* ;* For the HC12B32, the printf address is $f686 and RAM should start at $0800 ;* ASCII code: $0a = newline, $00 = null, $0d = carriage return ;* ;* Built using Code Warrior and ee3376 stationery ;* ;* 2 Dec 03 ;* ;**************************************************************** ; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as application entry point PSEUDO_ROM EQU $1000 ; absolute address to place code/constant data RAM EQU $2000 ; absolute address to place variables STACK EQU $3C00 ; definitions printf: EQU $ee88 ; pointer to D-Bug12 subroutine on HCS12 CR: EQU $0D ; ASCII carriage return NL: EQU $0A ; ASCII newline NULL: EQU $00 ; ASCII null to terminate a string ;----------------------------------------------------- ; variable/data section ORG RAM first_line: dc.b NL,'----',NL,CR,NL,NULL hola: dc.b 'Hola! El Paso', NULL last_line: dc.b NL,CR,NL, '----',NL,NL,NULL ;------------------------------------------------------ ; code section ORG PSEUDO_ROM ;set PC to $1000 Entry: lds #STACK ; initialize the stack ; print first line '----' ldd #first_line ldx printf jsr 0,x ; print 'Hola! El Paso' ldd #hola ; put string into d ldx printf ; ldx with address of printf subroutine jsr 0,x ; print last line '----' ldd #last_line ldx printf jsr 0,x swi ; end the program ;****************************************************************