VolksForth/8086/msdos/serial.fb

1 line
22 KiB
Plaintext
Raw Normal View History

2017-04-23 22:25:49 +00:00
\ Serial interface for IBM-PC using 8250 chip cas 11nov05 INCLUDE SERIAL.FB will load code for COM1, 2 LOADFROM SERIAL.FB for COM2 Bytes recieved will be buffered in a 128 Byte deep Queue by an interrupt Routine. The DTR Line will be used to signal that new bytes can be recieved. The Sender will recognize CTS, a full Handshake is implemented Xon/Xoff Protocoll using ^S/^Q is _not_ implemented. Sender: TX? ( -- f ) TX ( -- char ) Empf<70>nger: RX? ( -- f ) RX ( char -- ) \ Driver for IBM-PC Serial card using 8250 cas 11nov05 Onlyforth \needs Assembler 2 loadfrom asm.fb cr .( COM1: ) | $C 4 * Constant SINT@ \ absolute loc. of serial interrupt $3F8 >label Portadr | $10 Constant I_level \ 8259 priority 2 7 +thru \ Driver for IBM-PC Serial card using 8250 cas 11nov05 Onlyforth \needs Assembler 2 loadfrom asm.fb cr .( COM2: ) | $B 4 * Constant SINT@ \ absolute loc. of serial interrupt $2F8 >label Portadr | 8 Constant I_level \ 8259 priority 1 6 +thru \ Driver for IBM-PC Serial card using 8250 ks 11 mai 88 \ 3 .( 38.4 kbaud ) \ &6 .( 19.2 kbaud ) &12 .( 9.6 kbaud ) \ &24 .( 4.8 kbaud ) \ &96 .( 1200 baud ) >label baud $20 >label I_ctrl $21 >label I_mask \ 8259 addresses Create Queue 0 , $80 allot \ 0 1 2 130 byte address \ | len | out |<-- 128 byte Queue -->| \ len ::= number of characters queued \ out ::= relativ address of next output character \ (len+out)mod(128) ::= relative address of first empty byte