
 lib environment
 sttl System console Code - 8250
 pag
 name sys8250
 global systpc,sysrtt,sysbrg

*
* These are non-interrupt output routines for the system
* console.
*

*
* systpc
*
* Output the character in A.  X points to the port.  All
* registers should be preserved.
*

systpc pshs d save a reg
 ldb #io_map make sure I/O is mapped in
 stb DATBOX+$0F
2 lda 5,x get acia status
 bita #$20 xmit busY?
 beq 2b
 puls d get character
 sta 0,x output char
 rts return


*
* sysrtt
*
* Reset the console port.  X points to port.  Preserve all but A reg.
*

sysrtt lda #io_map map in I/O devices
 sta DATBOX+$0F
 sta sysmap+$0F
 lda #$83 set up br
 sta 3,x
 ldd #26 br divisor - 9600 B
 exg a,b
 std 0,x
 lda #$3 set up data types
 sta 3,x
 lda #$B set rts/cts/LED
 sta 4,x
 clr 1,x disable ints
 ldd #15000 delay for init complete
10 subd #1
 bne 10b
 rts return


*
* sysbrg
*
* Setup baud rates.  Y points to receive baud rate, U points to xmit.
* A has configuration byte.  Preserve all regs but A.
*

sysbrg rts


