annotate level1/modules/sc6551dragon.asm @ 2897:260116065a2f lwtools-port

arcadepak: Add empty_smash.txt and empty_thexder.txt dummy files This was done in default branch in commit 9b29d654db13 but did not get into the lwtools branch. We'll probably do this differently later, but for now I'll just pick this solution. At this point everything I have spotted of useful changes in the default branch has been pushed to the lwtools branch. I have cherry-picked changes both ways in order to make a merge easier, but a real merge will probably not be useful. I did try it out and waded through merge conflicts and diff'ed the result with current lwtools branch, so I am pretty sure nothing useful will be lost.
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 11 Jan 2014 18:20:09 +0100
parents d3b51489cb58
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
1 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
2 * Dragon 64/Alpha 6551 serial port driver
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
3 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
4 * Disassembled 2005/04/25 00:12:02 by Disasm v1.5 (C) 1988 by RML
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
5 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
6 * The Dragon 64 and Dragon Alpha have a hardware serial port driven
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
7 * by a Rockwell 6551, mapped from $FF04-$FF07.
240
7c673ea162ca That's the lot. Devicedrivers and device descriptors from Dragon
roug
parents:
diff changeset
8 *
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
9 * Communication between the read/write routines and the ACIA, is buffered
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
10 * using a pair of ring buffers, when disassembling labels have been assigned
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
11 * so that bytes are placed into the Rx/Tx queue Tail, and removed from the
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
12 * head. When the queues become full the calling process is put to sleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
13 * while it awiaits Rx/Tx from the remote device.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
14 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
15 * 2005-05-01, P.Harvey-Smith.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
16 * Initial disassembly.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
17 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
18 * 2005-10-24, P.Harvey-Smith.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
19 * Code clean up/commenting.
240
7c673ea162ca That's the lot. Devicedrivers and device descriptors from Dragon
roug
parents:
diff changeset
20 *
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
21
2043
d3b51489cb58 More updates
boisy
parents: 2042
diff changeset
22 nam sc6551
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
23 ttl os9 device driver
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
24
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
25 ifp1
2042
boisy
parents: 1966
diff changeset
26 use defsfile
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
27 endc
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
28
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
29 * Following definitions borrowed from sc6551.asm
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
30
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
31 * Status bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
32 Stat.IRQ equ %10000000 IRQ occurred
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
33 Stat.DSR equ %01000000 DSR level (clear = active)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
34 Stat.DCD equ %00100000 DCD level (clear = active)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
35 Stat.TxE equ %00010000 Tx data register Empty
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
36 Stat.RxF equ %00001000 Rx data register Full
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
37 Stat.Ovr equ %00000100 Rx data Overrun error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
38 Stat.Frm equ %00000010 Rx data Framing error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
39 Stat.Par equ %00000001 Rx data Parity error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
40
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
41 Stat.Err equ Stat.Ovr!Stat.Frm!Stat.Par Status error bits
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
42 Stat.Flp equ $00 all Status bits active when set
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
43 Stat.Msk equ Stat.IRQ!Stat.RxF active IRQs
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
44
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
45 * Control bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
46 Ctl.Stop equ %10000000 stop bits (set=two, clear=one)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
47 Ctl.DBit equ %01100000 see data bit table below
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
48 Ctl.RxCS equ %00010000 Rx clock source (set=baud rate, clear=external)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
49 Ctl.Baud equ %00001111 see baud rate table below
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
50
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
51 * data bit table
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
52 DB.8 equ %00000000 eight data bits per character
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
53 DB.7 equ %00100000 seven data bits per character
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
54 DB.6 equ %01000000 six data bits per character
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
55 DB.5 equ %01100000 five data bits per character
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
56
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
57 * baud rate table
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
58 org $00
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
59 BR.ExClk rmb 1 16x external clock (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
60 org $11
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
61 BR.00050 rmb 1 50 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
62 BR.00075 rmb 1 75 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
63 BR.00110 rmb 1 109.92 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
64 BR.00135 rmb 1 134.58 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
65 BR.00150 rmb 1 150 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
66 BR.00300 rmb 1 300 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
67 BR.00600 rmb 1 600 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
68 BR.01200 rmb 1 1200 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
69 BR.01800 rmb 1 1800 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
70 BR.02400 rmb 1 2400 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
71 BR.03600 rmb 1 3600 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
72 BR.04800 rmb 1 4800 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
73 BR.07200 rmb 1 7200 baud (not supported)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
74 BR.09600 rmb 1 9600 baud
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
75 BR.19200 rmb 1 19200 baud
240
7c673ea162ca That's the lot. Devicedrivers and device descriptors from Dragon
roug
parents:
diff changeset
76
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
77 * Command bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
78 Cmd.Par equ %11100000 see parity table below
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
79 Cmd.Echo equ %00010000 local echo (set=activated)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
80 Cmd.TIRB equ %00001100 see Tx IRQ/RTS/Break table below
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
81 Cmd.RxI equ %00000010 Rx IRQ (set=disabled)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
82 Cmd.DTR equ %00000001 DTR output (set=enabled)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
83
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
84 * parity table
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
85 Par.None equ %00000000
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
86 Par.Odd equ %00100000
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
87 Par.Even equ %01100000
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
88 Par.Mark equ %10100000
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
89 Par.Spac equ %11100000
240
7c673ea162ca That's the lot. Devicedrivers and device descriptors from Dragon
roug
parents:
diff changeset
90
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
91 * Tx IRQ/RTS/Break table
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
92 TIRB.Off equ %00000000 RTS & Tx IRQs disabled
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
93 TIRB.On equ %00000100 RTS & Tx IRQs enabled
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
94 TIRB.RTS equ %00001000 RTS enabled, Tx IRQs disabled
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
95 TIRB.Brk equ %00001100 RTS enabled, Tx IRQs disabled, Tx line Break
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
96
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
97 * V.ERR bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
98 DCDLstEr equ %00100000 DCD lost error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
99 OvrFloEr equ %00000100 Rx data overrun or Rx buffer overflow error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
100 FrmingEr equ %00000010 Rx data framing error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
101 ParityEr equ %00000001 Rx data parity error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
102
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
103 * FloCtlRx bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
104 FCRxSend equ %10000000 send flow control character
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
105 FCRxSent equ %00010000 Rx disabled due to XOFF sent
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
106 FCRxDTR equ %00000010 Rx disabled due to DTR
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
107 FCRxRTS equ %00000001 Rx disabled due to RTS
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
108
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
109 * FloCtlTx bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
110 FCTxXOff equ %10000000 due to XOFF received
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
111 FCTxBrk equ %00000010 due to currently transmitting Break
240
7c673ea162ca That's the lot. Devicedrivers and device descriptors from Dragon
roug
parents:
diff changeset
112
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
113 * Wrk.Type bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
114 Parity equ %11100000 parity bits
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
115 MdmKill equ %00010000 modem kill option
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
116 RxSwFlow equ %00001000 Rx data software (XON/XOFF) flow control
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
117 TxSwFlow equ %00000100 Tx data software (XON/XOFF) flow control
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
118 RTSFlow equ %00000010 CTS/RTS hardware flow control
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
119 DSRFlow equ %00000001 DSR/DTR hardware flow control
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
120
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
121 * Wrk.Baud bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
122 StopBits equ %10000000 number of stop bits code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
123 WordLen equ %01100000 word length code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
124 BaudRate equ %00001111 baud rate code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
125
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
126 * Wrk.XTyp bit definitions
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
127 SwpDCDSR equ %10000000 swap DCD+DSR bits (valid for 6551 only)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
128 ForceDTR equ %01000000 don't drop DTR in term routine
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
129 RxBufPag equ %00001111 input buffer page count
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
130
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
131 * End of borrowed stuff :)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
132
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
133 tylg set Drivr+Objct
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
134 atrv set ReEnt+rev
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
135 rev set $01
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
136 mod eom,name,tylg,atrv,start,size
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
137
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
138 RxQueueTailOffset rmb 1 ; Tail of Rx queue, Rx inturrupt inserts here
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
139 RxQueueHeadOffset rmb 1 ; Head of Rx queue, read call fetches from here
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
140 u001F rmb 1
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
141 TxQueueTailOffset rmb 1 ; Tail of Tx queue, write call inserts here
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
142 TxQueueHeadOffset rmb 1 ; Head of Tx queue, Tx inturrupt fetches here
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
143 u0022 rmb 1
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
144 u0023 rmb 1 ; something to do with XON/XOFF
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
145 u0024 rmb 2
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
146 SavedDSRDCD rmb 1 ; Saved DSR and DCD ststus
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
147 RxQueue rmb 80 ; Rx Queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
148 RxQueueLen EQU *-RxQueue ; Rx queue length
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
149
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
150 TxQueue rmb 140 ; Tx Queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
151 TxQueueLen EQU *-TxQueue ; Tx Queue length
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
152
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
153 size equ .
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
154
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
155 fcb $03
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
156
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
157 name equ *
2043
d3b51489cb58 More updates
boisy
parents: 2042
diff changeset
158 fcs /sc6551/
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
159 fcb $04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
160
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
161 start equ *
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
162
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
163 lbra Init
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
164 lbra Read
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
165 lbra Write
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
166 lbra GetSta
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
167 lbra SetSta
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
168 lbra Term
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
169
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
170 IRQPkt
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
171 FCB $00 ; Normal bits (flip byte)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
172 FCB $80 ; Bit 1 is interrupt request flag (Mask byte)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
173 FCB $0A ; Priority byte
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
174
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
175
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
176 * Init
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
177 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
178 * Entry:
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
179 * Y = address of device descriptor
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
180 * U = address of device memory area
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
181 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
182 * Exit:
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
183 * CC = carry set on error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
184 * B = error code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
185 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
186
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
187 Init LDX V.PORT,U ; 1,U Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
188 stb AciaStat,x ; Write to status reg, this resets ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
189 ldb #$02
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
190 stb <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
191 ldd <IT.PAR,y ; Get parity & baud rate <$26,y
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
192
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
193 andb #$0F
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
194 leax <BaudRateTable,pcr ; Calculate baud rate values for Acia
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
195 ldb b,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
196
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
197 anda #$F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
198 sta V.TYPE,u ; Save parity bits for later use
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
199 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
200 std AciaCmd,x ; Setup Command (A), Control (B,Baud rates).
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
201 lda ,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
202 lda ,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
203 tst AciaStat,x ; Get status
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
204 lbmi ErrorExit ; Error if int occoured
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
205
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
206 clra ; Init some static storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
207 clrb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
208 std <RxQueueTailOffset,u ; Init Rx queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
209 std <TxQueueTailOffset,u ; Init Tx queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
210 sta <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
211 sta <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
212 std <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
213
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
214 ldd V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
215 addd #$0001 ; Setup V$IRQ on status reg changes
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
216 leax >IRQPkt,pcr ; Point to packet
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
217 leay >IRQService,pcr ; Point to handler
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
218 os9 F$IRQ ; Install it !
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
219 bcs InitExit ; Error : Exit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
220
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
221 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
222 ldb V.TYPE,u ; Get device parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
223 orb #Cmd.DTR ; SET DTR, flag us as ready
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
224 stb AciaCmd,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
225 clrb ; Flag no error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
226 InitExit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
227 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
228
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
229 ;
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
230 ; Baud rate table, all baud rates use external clock.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
231 ;
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
232
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
233 BaudRateTable
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
234 fcb Ctl.RxCS+BR.00110
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
235 fcb Ctl.RxCS+BR.00300
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
236 fcb Ctl.RxCS+BR.00600
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
237 fcb Ctl.RxCS+BR.01200
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
238 fcb Ctl.RxCS+BR.02400
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
239 fcb Ctl.RxCS+BR.04800
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
240 fcb Ctl.RxCS+BR.09600
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
241 fcb Ctl.RxCS+BR.19200
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
242
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
243 PutProcToSleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
244 bsr DoPutProcToSleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
245
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
246 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
247 * Input U = Address of device static data storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
248 * Y = Address of path descriptor module
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
249 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
250 * Output
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
251 * A = Character read
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
252 * CC = carry set on error, clear on none
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
253 * B = error code if CC.C set.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
254 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
255
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
256
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
257 Read lda <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
258 ble L00A1
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
259
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
260 ldb <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
261 cmpb #$0A
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
262 bhi L00A1
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
263
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
264 ldb V.XON,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
265 orb #$80
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
266 stb <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
267
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
268 ldb V.TYPE,u ; Get prity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
269 orb #TIRB.On+Cmd.DTR ; Enable tranmitter inturrupt & DTR ($05)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
270 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
271 stb AciaCmd,x ; Write to ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
272
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
273 L00A1 tst <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
274 bne ErrorExit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
275
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
276 ldb <RxQueueHeadOffset,u ; Get queue head ptr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
277 leax <RxQueue,u ; Get Rx Queue address
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
278
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
279 orcc #$50 ; Disable Inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
280 cmpb <RxQueueTailOffset,u ; Is Head=Tail, and therefore queue empty ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
281 beq PutProcToSleep ; Yes : sleep and await input from remote device
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
282
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
283 abx ; Calculate pos in queue for next char
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
284 lda ,x ; Get byte from read queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
285 dec <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
286 incb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
287 cmpb #RxQueueLen-1 ; Reached end of queue area ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
288 bls L00BF ; no : continue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
289
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
290 clrb ; Wrap tail pointer to the beginning of queue space
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
291 L00BF stb <RxQueueHeadOffset,u ; save new queue pointer
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
292 clrb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
293 ldb V.ERR,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
294 beq L00CF ; No error : exit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
295
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
296 stb <$3A,y
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
297 clr V.ERR,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
298 comb ; Flag and return error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
299 ldb #$F4
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
300 L00CF andcc #$AF ; Enable inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
301 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
302
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
303 ErrorExit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
304 comb ; Flag error & return
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
305 ldb #$F6
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
306 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
307
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
308 ;
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
309 ; Put calling process to sleep while we await input or output from remote device.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
310 ;
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
311
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
312 DoPutProcToSleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
313 pshs x,b,a
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
314 lda V.BUSY,u ; Get busy process
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
315 sta V.WAKE,u ; Store in proc to wake
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
316 andcc #$AF ; Enable inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
317 ldx #$0000 ; Sleep indefinatly
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
318 os9 F$Sleep ; Put caller to sleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
319
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
320 ldx <D.Proc ; Get current proces descriptor addr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
321 ldb <P$Signal,x ; Get signal code of proc
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
322 beq L00EF
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
323
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
324 cmpb #$03
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
325 bls L00F8
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
326
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
327 L00EF clra
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
328 lda P$State,x ; Get process state
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
329 bita #Condem ; Process condemed ? (being killed ?)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
330 bne L00F8 ; yes : error, exit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
331
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
332 puls pc,x,b,a ; Return
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
333
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
334 L00F8 leas $06,s
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
335 coma
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
336 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
337
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
338 L00FC bsr DoPutProcToSleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
339
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
340 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
341 * Input U = Address of device static data storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
342 * Y = Address of path descriptor module
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
343 * A = Character to write
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
344 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
345 * Output
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
346 * CC = carry set on error, clear on none
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
347 * B = error code if CC.C set.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
348 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
349
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
350 Write leax <TxQueue,u ; Get pointer to transmit queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
351 ldb <TxQueueTailOffset,u ; Get offset of end of TX queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
352 abx ; Calculate next free queue slot
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
353 sta ,x ; Put byte to transmit in queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
354 incb ; Increment queue tail ptr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
355 cmpb #TxQueueLen-1 ; End of Queue area ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
356 bls L010D ; no, continue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
357 clrb ; Point at begining of queue area
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
358
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
359 L010D orcc #$50 ; Disable inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
360 cmpb <TxQueueHeadOffset,u ; is Head=Tail therefore queue full ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
361 beq L00FC ; Yes : sleep process until room in queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
362
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
363 stb <TxQueueTailOffset,u ; Re-save tail pointer
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
364 lda <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
365 beq L012B
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
366
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
367 anda #$FD
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
368 sta <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
369 bne L012B
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
370
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
371 lda V.TYPE,u ; Get parity bits
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
372 ora #TIRB.On+Cmd.DTR ; Enable tranmitter inturrupt & DTR ($05)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
373 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
374 sta AciaCmd,x ; Write to ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
375
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
376 L012B andcc #$AF ; Enable Inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
377 L012D clrb ; Flag no error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
378 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
379
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
380 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
381 * Input U = Address of device static data storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
382 * Y = Address of path descriptor module
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
383 * A = Status code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
384 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
385 * Output
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
386 * Depends on status code.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
387 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
388
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
389 GetSta cmpa #SS.Ready ; Device ready ? ($01)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
390 bne L013E
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
391
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
392 ldb <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
393 beq ErrorExit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
394
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
395 ldx $06,y
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
396 stb $02,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
397 L013C clrb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
398 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
399
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
400 L013E cmpa #SS.EOF ; EOF ? ($06)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
401 beq L012D
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
402
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
403 L0142 comb ; Flag error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
404 ldb #$D0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
405 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
406
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
407 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
408 * Input U = Address of device static data storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
409 * Y = Address of path descriptor module
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
410 * A = Status code
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
411 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
412 * Output
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
413 * Depends on status code.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
414 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
415
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
416 SetSta cmpa #SS.SSig ; Send signal on data ready ? ($1A)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
417 bne L0161
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
418
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
419 lda PD.CPR,y ; Get caller's process id
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
420 ldx PD.RGS,y ; Get caller's Regs
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
421 ldb $05,x ; Get lower half of X ????
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
422
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
423 orcc #$50 ; Disable inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
424 tst <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
425 bne L015C
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
426
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
427 std <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
428 bra L012B
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
429
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
430 L015C andcc #$AF
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
431 lbra L01F8
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
432
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
433 L0161 cmpa #SS.Relea ; Release device ? ($1B)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
434 bne L0142
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
435
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
436 lda PD.CPR,y ; Get calling process ID
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
437 cmpa <u0024,u ; Same process ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
438 bne L013C ; no !
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
439
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
440 clr <u0024,u ; Yes : release
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
441 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
442
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
443 L0170 lbsr DoPutProcToSleep
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
444
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
445 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
446 * Input U = Address of device static data storage
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
447 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
448 * Output
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
449 * CC = carry set on error, clear on none
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
450 * B = error code if CC.C set.
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
451 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
452
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
453 Term ldx <D.Proc ; Get current process descriptor addr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
454 lda P$ID,x ; Get process ID
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
455 sta V.BUSY,u ; Save it in busy and last processs
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
456 sta V.LPRC,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
457
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
458 ldb <TxQueueTailOffset,u ; Check we have sent all bytes ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
459 orcc #$50
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
460 cmpb <TxQueueHeadOffset,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
461 bne L0170 ; Still bytes left to send, wait to send them
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
462
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
463 lda V.TYPE,u ; Get Parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
464 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
465 sta AciaCmd,x ; Set parity in ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
466 andcc #$AF ; Enable inturrupts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
467
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
468 ldx #$0000 ; Remove IRQ handler
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
469 os9 F$IRQ
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
470 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
471
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
472 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
473 * F$IRQ handler,
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
474 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
475 * Input :
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
476 * A = Status byte XOR flip
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
477 * U = our data area
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
478 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
479 * In this case, since flip byte is zero, and any value XOR zero
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
480 * remains uncahanged, A contains the contents of the ACIA status
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
481 * register ($FF05)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
482 *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
483
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
484 IRQService
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
485 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
486 tfr a,b ; Take a copy of status
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
487 andb #Stat.DSR+Stat.DCD ; Mask all but DSR & DCD ($60)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
488 cmpb <SavedDSRDCD,u ; Compare to saved
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
489 beq L01AB ; not changed, check other bits
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
490
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
491 stb <SavedDSRDCD,u ; Save DSR & DCD values
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
492 bitb #$60 ; Was either set ???
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
493 lbne L02AE ; yes
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
494 lbra L029C
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
495
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
496 L01AB bita #Stat.RxF ; Rx register full ? ($08)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
497 bne L01FD ; yes
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
498
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
499 lda <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
500 bpl L01C4
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
501
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
502 anda #$7F
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
503 sta ,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
504 eora V.XON,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
505 sta <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
506 lda <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
507 bne L01EA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
508
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
509 clrb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
510 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
511
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
512 L01C4 leay <TxQueue,u ; Point to transmit queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
513 ldb <TxQueueHeadOffset,u ; Check that there are bytes to transmit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
514 cmpb <TxQueueTailOffset,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
515 beq L01E2 ; no : skip
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
516
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
517 clra
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
518 lda d,y ; Get byte to transmit
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
519 incb ; Increment head offset ptr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
520 cmpb #TxQueueLen-1 ; Head at end of Queue area ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
521 bls L01D8
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
522
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
523 clrb ; Yes : point it at beginning
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
524 L01D8 stb <TxQueueHeadOffset,u ; Save it
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
525 sta AciaData,x ; Transmit byte
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
526 cmpb <TxQueueTailOffset,u ; Head=Tail therefore Tx queue empty ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
527 bne L01F0 ; no : skip ahead
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
528
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
529 L01E2 lda <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
530 ora #$02
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
531 sta <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
532
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
533 L01EA ldb V.TYPE,u ; Get parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
534 orb #Cmd.DTR ; Enable DTR, ready
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
535 stb AciaCmd,x ; Write to ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
536
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
537 L01F0 ldb #S$Wake ; Wake up calling process
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
538 lda V.WAKE,u ; Get proc ID to wake
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
539 L01F4 beq L01FB
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
540
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
541 clr V.WAKE,u ; Clear saved wake proc ID
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
542 L01F8 os9 F$Send ; send wakeup signal
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
543 L01FB clrb ; Flag no error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
544 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
545
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
546 L01FD bita #Stat.Par+Stat.Frm+Stat.Ovr ; Check for Parity/Framing/Overrun errors ($07)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
547 beq L0213 ; No Error detected, do read
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
548
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
549 tfr a,b ; Copy status
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
550 tst ,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
551 anda #$07
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
552 ora V.ERR,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
553 sta V.ERR,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
554 lda $02,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
555 sta $01,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
556 sta $02,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
557 bra L01FB
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
558
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
559 L0213 lda ,x ; Read byte from ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
560 beq L022E ; zero, branch ahead
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
561
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
562 cmpa V.INTR,u ; Inturrupt char ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
563 beq L028B
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
564
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
565 cmpa V.QUIT,u ; Quit char ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
566 beq L028F
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
567
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
568 cmpa V.PCHR,u ; Pause char ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
569 beq L0283
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
570
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
571 cmpa V.XON,u ; Xon char ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
572 beq L029C
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
573
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
574 cmpa <V.XOFF,u ; Xoff char ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
575 lbeq L02AE
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
576
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
577 ;
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
578 ; If we reach here, char is nothing special, so just put it in queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
579 ;
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 507
diff changeset
580
1966
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
581 L022E leax <RxQueue,u ; Point to receive queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
582 ldb <RxQueueTailOffset,u ; Get tail offset
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
583 abx ; Calculate address
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
584 sta ,x ; Put char in queue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
585 incb ; increment tail ptr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
586 cmpb #RxQueueLen-1 ; End of queue area ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
587 bls L023D ; no : continue
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
588
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
589 clrb ; point to begining of Rx queue area
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
590 L023D cmpb <RxQueueHeadOffset,u ; Same as head of queue ?
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
591 bne L024A ; no :
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
592
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
593 ldb #$04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
594 orb V.ERR,u ; accumulated errors
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
595 stb V.ERR,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
596 bra L01F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
597
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
598 L024A stb <RxQueueTailOffset,u ; Save tail ptr
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
599 inc <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
600 tst <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
601 beq L025D
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
602
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
603 ldd <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
604 clr <u0024,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
605 bra L01F8
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
606
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
607 L025D lda <V.XOFF,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
608 beq L01F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
609
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
610 ldb <u001F,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
611 cmpb #$46
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
612 bcs L01F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
613
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
614 ldb <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
615 bne L01F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
616
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
617 anda #$7F
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
618 sta <V.XOFF,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
619 ora #$80
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
620 sta <u0023,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
621
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
622 ldb V.TYPE,u ; Get parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
623 orb #TIRB.On+Cmd.DTR ; Enable tranmitter inturrupt & DTR ($05)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
624 ldx V.PORT,u ; Get port address $FF04
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
625 stb AciaCmd,x ; Write to acia
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
626
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
627 lbra L01F0
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
628 L0283 ldx V.DEV2,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
629 beq L022E
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
630
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
631 sta $08,x
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
632 bra L022E
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
633
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
634 L028B ldb #$03
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
635 bra L0291
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
636
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
637 L028F ldb #$02
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
638 L0291 pshs a
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
639
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
640 lda V.LPRC,u ; Get last active proc ID
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
641 lbsr L01F4 ; Wake process
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
642 puls a
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
643 bra L022E
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
644
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
645 L029C lda <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
646 anda #$FE
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
647 sta <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
648 bne L02AC
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
649
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
650 lda V.TYPE,u ; Get parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
651 ora #TIRB.On+Cmd.DTR ; Enable tranmitter inturrupt & DTR ($05)
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
652 sta AciaCmd,x ; Write to ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
653 L02AC clrb ; Flag no error
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
654 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
655
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
656 L02AE lda <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
657 bne L02B9
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
658
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
659 ldb V.TYPE,u ; Get parity settings
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
660 orb #Cmd.DTR ; Enable DTR
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
661 stb AciaCmd,x ; Write to ACIA
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
662
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
663 L02B9 ora #$01
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
664 sta <u0022,u
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
665 clrb
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
666 rts
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
667
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
668 emod
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
669 eom equ *
4de571b41659 Added lots of comments should now compile and work.
afra
parents: 1287
diff changeset
670 end