; sends 32768 characters from optrom to serial port
; runs from altLCD

;------------------------------------------------------
;M100 constants
SD232C:	.equ	6E32h
ALTLCD:	.equ	0FCC0h	
NUMPRT: .equ	39D4h
CLS:	.equ	4231h
;------------------------------------------------------





       	.org    ALTLCD



start:  

	lxi     h,0000h

loop:   di
;------------------------------------------------------
; M100 code
       	mvi     a,1
       	out     0E8h  ; get option rom , M100
;-------------------------------------------------------


       	mov     a,m     ; read a from location in hl
       	push    psw     ; push a on stack

;------------------------------------------------------
; M100 code
       	mvi     a,0
       	out     0E8h  ; get option rom , M100
;-------------------------------------------------------


       	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