; sends 32768 characters from optrom to serial port
; runs from altLCD


;------------------------------------------------------
;T200 contstants
SD232C:	.equ	8643h
ALTLCD:	.equ	0F7B0h	
NUMPRT: .equ	470Bh
CLS:	.equ	4F4Dh
;------------------------------------------------------

       	.org    ALTLCD



start:  lxi     h,0000h

loop:   di

;-------------------------------------------------------
; T200 code
	
	in	0D8H

	ani	11111100b
	ori	00000010b

	out	0D8H
;-------------------------------------------------------


       	mov     a,m     ; read a from location in hl

       	push    psw     ; push a on stack

;-------------------------------------------------------
; T200 code
	
	in	0D8H

	ani	11111100b
	ori	00000000b

	out	0D8H
;-------------------------------------------------------

       	ei              ; done with option rom


       	pop     psw     ; get a back
       	push    psw     ; temp store a

       	ani     0f0h    ; and it with 11110000
       	rar
       	rar
       	rar
       	rar             ; rotate 4x right

      	call    senda

       	pop     psw     ; get a back again
       	ani     0fH     ; and it with 00001111

       	call    senda


       	inx     h       ; increment h
       	mov     a,h
       	cpi     080h
       	jnz     loop    ; loop back if h <> 80h



       	ret




senda:	push 	h      		; temp store hl
       	lxi     h,hex_table  	; point hl to data
       	mov     c,a
       	mvi     b,0
       	dad     b       	; add 000000000000aaaa to data location
       	mov     a,m     	; load a with character to send
       	call    SD232C  	; send it
       	pop     h       	; restore hl
       	ret


hex_table:
	.db      30h,31h,32h,33h,34h,35h,36h,37h,38h,39h
       	.db      41h,42h,43h,44h,45h,46h
               	; 0123456789ABCDEF


	.end