;FILENAME:   STLAB042.ASM
;DATE:       March 16, 1996
;TITLE:      Parallel Printer Interface
;HARDWARE:   JAZZ-31

; JAZZ-31 utilities subroutines
DMSEC   EQU     003FH   ;delay 1/1000 sec
HTOA    EQU     00EAH   ;HEX to ASCII
; ASCII definitions
CR      EQU     0DH     ;carriage return code
LF      EQU     0AH     ;line feed code
;
; Program 2: Print characters
;
        ORG     8100H
START:
        MOV     DPTR,#TST_STR   ;locate string
        LCALL   PRINT_STRING    ;print a string
        SJMP    $
;
TST_STR:
        DB      'This is a string', CR, LF, '$'
;
; Print a string which store in program memory
; IN:  DPTR ROM-ADDRESS (terminate with '$')
;
PRINT_STRING:
         CLR    A
PRSTR1:
         PUSH   ACC
         MOVC   A,@A+DPTR
         CJNE   A,#'$',PRSTR2   ;check terminator
         SJMP   PRSTR3
PRSTR2:
         LCALL  PBYTE
         POP    ACC
         INC    A          ;step to next char
         SJMP   PRSTR1
PRSTR3:
         POP    ACC
         MOV    A,#CR
         LCALL  PBYTE
         MOV    A,#LF
         LCALL  PBYTE
         RET
;
	 $INCLUDE  "STLAB04H.ASM"
;
         END
