annotate level1/modules/dw3.asm @ 2720:482a547d5155 lwtools-port

Fixed so OP_DWINIT puts response in globals OP_SETTIME not sent unless response from OP_DWINIT from server is 128
author Boisy Pitre <boisy.pitre@nuance.com>
date Thu, 26 Jul 2012 12:19:43 -0500
parents 8399491c0821
children 22bdfbe8bc68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
1 ********************************************************************
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
2 * DW3 - DriveWire 3 Low Level Subroutine Module
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
3 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
4 * $Id$
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
5 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
7 * Comment
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
9 * 1 2008/01/26 Boisy G. Pitre
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
10 * Started as a segregated subroutine module.
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
11 *
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
12 * 2 2010/01/20 Boisy G. Pitre
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
13 * Added support for DWNet
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
14 *
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
15 * 3 2010/01/23 Aaron A. Wolfe
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
16 * Added dynamic polling frequency
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
17 *
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
18 nam DW3
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
19 ttl DriveWire 3 Low Level Subroutine Module
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
20
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
21 ifp1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
22 use defsfile
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2435
diff changeset
23 use drivewire.d
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
24 endc
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
25
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
26 tylg set Sbrtn+Objct
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
27 atrv set ReEnt+rev
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
28 rev set $01
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
29
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
30 mod eom,name,tylg,atrv,start,0
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
31
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
32 * irq
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
33 IRQPckt fcb $00,$01,$0A ;IRQ packet Flip(1),Mask(1),Priority(1) bytes
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
34 * Default time packet
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
35 DefTime fcb 109,12,31,23,59,59
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
36
2435
f3f09398780b initial RFM
aaronwolfe
parents: 2429
diff changeset
37 * for dynamic poll frequency, number of ticks between firing poller - should we move to dwdefs?
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
38 * speed 1 = interactive (typing)
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
39 PollSpd1 fcb 3
2435
f3f09398780b initial RFM
aaronwolfe
parents: 2429
diff changeset
40 * speed 2 = bulk transfer (depending on how much processing needs to be done to incoming stream, 5-8 seems good)
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
41 PollSpd2 fcb 6
2435
f3f09398780b initial RFM
aaronwolfe
parents: 2429
diff changeset
42 * speed 3 = idle
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
43 PollSpd3 fcb 40
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
44 * X pollidle -> drop to next slower rate
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
45 PollIdle fcb 60
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
46
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
47
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
48 name fcs /dw3/
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
49
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
50 * DriveWire subroutine entry table
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
51 start lbra Init
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
52 bra Read
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
53 nop
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
54 lbra Write
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
55
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
56 * Term
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
57 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
58 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
59 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
60 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
61 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
62 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
63 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
64 *
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
65 Term
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
66 clrb clear Carry
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
67 rts
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
68
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
69 Read
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
70 use dwread.asm
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
71
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
72 Write
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
73 use dwwrite.asm
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
74
2638
4655eabf00c0 dw3.asm is now common... dwinit.asm now added to for port specific initialization
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2624
diff changeset
75
4655eabf00c0 dw3.asm is now common... dwinit.asm now added to for port specific initialization
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2624
diff changeset
76 use dwinit.asm
4655eabf00c0 dw3.asm is now common... dwinit.asm now added to for port specific initialization
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2624
diff changeset
77
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
78 * Init
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
79 *
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
80 * Entry:
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
81 * Y = address of device descriptor
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
82 * U = address of device memory area
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
83 *
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
84 * Exit:
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
85 * CC = carry set on error
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
86 * B = error code
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
87 *
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
88 * Initialize the serial device
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
89 Init
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
90 clrb clear Carry
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
91 pshs y,x,cc then push CC on stack
2638
4655eabf00c0 dw3.asm is now common... dwinit.asm now added to for port specific initialization
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2624
diff changeset
92 bsr DWInit
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
93
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
94 ; allocate DW statics page
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
95 pshs u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
96 ldd #$0100
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
97 os9 F$SRqMem
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
98 tfr u,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
99 puls u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
100 lbcs InitEx
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
101 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
102 stx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
103 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
104 stx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
105 endc
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
106 ; clear out 256 byte page at X
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
107 clrb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
108 loop@ clr ,x+
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
109 decb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
110 bne loop@
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
111
2321
6a5ada3e2666 added DWINIT op code, dw3 now sends on init just before installing VIRQ
aaronwolfe
parents: 2316
diff changeset
112 * send OP_DWINIT
6a5ada3e2666 added DWINIT op code, dw3 now sends on init just before installing VIRQ
aaronwolfe
parents: 2316
diff changeset
113 ; setup DWsub command
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
114 pshs u
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
115 ldb #1 ; DRIVER VERSION
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
116 lda #OP_DWINIT ; load command
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
117 pshs d ; command store on stack
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
118 leax ,s ; point X to stack
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
119 ldy #2 ; 1 byte to send
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
120 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
121 ldu <D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
122 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
123 ldu >D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
124 endc
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
125 jsr DW$Write,u ; call DWrite
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
126 leas 1,s ; leave one byte on stack for response
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
127
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
128 ; read protocol version response, 1 byte
2720
482a547d5155 Fixed so OP_DWINIT puts response in globals
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2714
diff changeset
129 ldx #D.DWSrvID
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
130 ldy #1 ; 1 byte to retrieve
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
131 jsr DW$Read,u ; call DWRead
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
132 beq InstIRQ ; branch if no error
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
133 leas 3,s ; error, cleanup stack (u and 1 byte from read)
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
134 lbra InitEx ; don't install IRQ handler
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
135
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
136 * install ISR
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
137 InstIRQ
2720
482a547d5155 Fixed so OP_DWINIT puts response in globals
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2714
diff changeset
138 puls a,u
2429
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
139
65541e2444dc use dwinit to become compatible with dw3 server
aaronwolfe
parents: 2422
diff changeset
140 ifgt Level-1
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
141 ldx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
142 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
143 ldx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
144 endc
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
145 leax DW.VIRQPkt,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
146 pshs u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
147 tfr x,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
148 leax Vi.Stat,x ;fake VIRQ status register
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
149 lda #$80 ;VIRQ flag clear, repeated VIRQs
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
150 sta ,x ;set it while we're here...
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
151 tfr x,d ;copy fake VIRQ status register address
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
152 leax IRQPckt,pcr ;IRQ polling packet
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
153 leay IRQSvc,pcr ;IRQ service entry
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
154 os9 F$IRQ ;install
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
155 puls u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
156 bcs InitEx ;exit with error
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
157 clra
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
158 ldb PollSpd3,pcr ; start at idle
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
159 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
160 ldx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
161 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
162 ldx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
163 endc
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
164 leax DW.VIRQPkt,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
165 std Vi.Rst,x ; reset count
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
166 tfr x,y ; move VIRQ software packet to Y
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
167 tryagain
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
168 ldx #$0001 ; code to install new VIRQ
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
169 os9 F$VIRQ ; install
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
170 bcc IRQok ; no error, continue
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
171 cmpb #E$UnkSvc
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
172 bne InitEx
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
173 ; if we get an E$UnkSvc error, then clock has not been initialized, so do it here
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
174 leax DefTime,pcr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
175 os9 F$STime
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
176 bra tryagain ; note: this has the slim potential of looping forever
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
177 IRQok
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
178 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
179 ldx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
180 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
181 ldx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
182 endc
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
183 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
184 leax DW.StatTbl,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
185 tfr u,d
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
186 ldb <V.PORT+1,u ; get our port #
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
187 sta b,x ; store in table
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
188
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
189 InitEx
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
190 puls cc,x,y,pc
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
191
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
192
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
193 ; ***********************************************************************
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
194 ; Interrupt handler - Much help from Darren Atkinson
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
195
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
196 IRQMulti3 anda #$0F ; mask first 4 bits, a is now port #+1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
197 deca ; we pass +1 to use 0 for no data
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
198 pshs a ; save port #
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
199 cmpb RxGrab,u ; compare room in buffer to server's byte
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
200 bhs IRQM06 ; room left >= server's bytes, no problem
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
201
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
202 stb RxGrab,u ; else replace with room left in our buffer
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
203
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
204 ; also limit to end of buffer
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
205 IRQM06 ldd RxBufEnd,u ; end addr of buffer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
206 subd RxBufPut,u ; subtract current write pointer, result is # bytes left going forward in buff.
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
207
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
208 IRQM05 cmpb RxGrab,u ; compare b (room left) to grab bytes
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
209 bhs IRQM03 ; branch if we have room for grab bytes
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
210
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
211 stb RxGrab,u ; else set grab to room left
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
212
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
213 ; send multiread req
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
214 IRQM03 puls a ; port # is on stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
215 ldb RxGrab,u
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
216
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
217 pshs u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
218
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
219 ; setup DWsub command
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
220 pshs d ; (a port, b bytes)
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
221 lda #OP_SERREADM ; load command
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
222 pshs a ; command store on stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
223 leax ,s ; point X to stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
224 ldy #3 ; 3 bytes to send
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
225
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
226 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
227 ldu <D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
228 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
229 ldu >D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
230 endc
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
231 jsr DW$Write,u ; call DWrite
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
232
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
233 leas 3,s ; clean 3 DWsub args from stack
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
234
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
235 ldx ,s ; pointer to this port's area (from U prior), leave it on stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
236 ldb RxGrab,x ; set B to grab bytes
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
237 clra ; 0 in high byte
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
238 tfr d,y ; set # bytes for DW
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
239
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
240 ldx RxBufPut,x ; point X to insert position in this port's buffer
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
241 ; receive response
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
242 jsr DW$Read,u ; call DWRead
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
243 ; handle errors?
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
244
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
245
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
246 puls u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
247 ldb RxGrab,u ; our grab bytes
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
248
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
249 ; set new RxBufPut
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
250 ldx RxBufPut,u ; current write pointer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
251 abx ; add b (# bytes) to RxBufPut
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
252 cmpx RxBufEnd,u ; end of Rx buffer?
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
253 blo IRQM04 ; no, go keep laydown pointer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
254 ldx RxBufPtr,u ; get Rx buffer start address
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
255 IRQM04 stx RxBufPut,u ; set new Rx data laydown pointer
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
256
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
257 ; set new RxDatLen
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
258 ldb RxDatLen,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
259 addb RxGrab,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
260 stb RxDatLen,u ; store new value
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
261
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
262 lbra CkSSig ; had to lbra
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
263
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
264 IRQMulti
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
265 ; set IRQ freq for bulk
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
266 pshs a
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
267 lda PollSpd2,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
268 lbsr IRQsetFRQ
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
269 puls a
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
270
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
271 ; initial grab bytes
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
272 stb RxGrab,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
273
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
274 ; limit server bytes to bufsize - datlen
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
275 ldb RxBufSiz,u ; size of buffer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
276 subb RxDatLen,u ; current bytes in buffer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
277 bne IRQMulti3 ; continue, we have some space in buffer
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
278 ; no room in buffer
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
279 tstb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
280 lbne CkSSig ;had to lbra
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
281 lbra IRQExit ;had to lbra
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
282
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
283
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
284 ; **** IRQ ENTRY POINT
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
285 IRQSvc equ *
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
286 pshs cc,dp ; save system cc,DP
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
287 orcc #IntMasks ; mask interrupts
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
288
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
289 ; mark VIRQ handled (note U is pointer to our VIRQ packet in DP)
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
290 lda Vi.Stat,u ; VIRQ status register
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
291 anda #^Vi.IFlag ; clear flag in VIRQ status register
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
292 sta Vi.Stat,u ; save it...
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
293
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
294 ; poll server for incoming serial data
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
295
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
296 ; send request
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
297 lda #OP_SERREAD ; load command
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
298 pshs a ; command store on stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
299 leax ,s ; point X to stack
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
300 ldy #1 ; 1 byte to send
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
301
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
302 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
303 ldu <D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
304 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
305 ldu >D.DWSubAddr
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
306 endc
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
307 jsr DW$Write,u ; call DWrite
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
309 ; receive response
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
310 leas -1,s ; one more byte to fit response
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
311 leax ,s ; point X to stack head
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
312 ldy #2 ; 2 bytes to retrieve
2640
8d24c482646e o increased timeout in atari dwread.asm module
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2638
diff changeset
313 jsr DW$Read,u ; call DWRead
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
314 beq IRQSvc2 ; branch if no error
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
315 leas 2,s ; error, cleanup stack 2
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
316 lbra IRQExit2 ; don't reset error count on the way out
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
317
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
318 ; process response
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
319 IRQSvc2
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
320 ldd ,s++ ; pull returned status byte into A,data into B (set Z if zero, N if multiread)
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
321 bne IRQGotOp ; branch if D != 0 (something to do)
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
322 * this is a NOP response.. do we need to reschedule
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
323 ifgt Level-1
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
324 ldx <D.DWStat
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
325 else
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
326 ldx >D.DWStat
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
327 endc
2422
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
328 lda DW.VIRQPkt+Vi.Rst+1,x
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
329 cmpa PollSpd3,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
330 lbeq IRQExit ;we are already at idle speed
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
331
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
332 lda DW.VIRQNOP,x
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
333 inca
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
334 cmpa PollIdle,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
335 beq FRQdown
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
336
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
337 sta DW.VIRQNOP,x ;inc NOP count, exit
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
338 lbra IRQExit
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
339
2422
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
340 FRQdown lda DW.VIRQPkt+Vi.Rst+1,x
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
341 cmpa PollSpd1,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
342 beq FRQd1
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
343 lda PollSpd3,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
344 FRQd2
2422
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
345 sta DW.VIRQPkt+Vi.Rst+1,x
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
346 clr DW.VIRQNOP,x
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
347 lbra IRQExit
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
348 FRQd1 lda PollSpd2,pcr
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
349 bra FRQd2
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
350
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
351 ; save back D on stack and build our U
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
352 IRQGotOp pshs d
2661
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
353 * mode switch on bits 7+6 of A: 00 = vserial, 01 = vwindow, 10 = wirebug?, 11 = ?
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
354 anda #$C0 ; mask last 6 bits
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
355 beq mode00 ; virtual serial mode
2311
b2bc1ad04163 Made changes
aaronwolfe
parents: 2308
diff changeset
356 ; future - handle other modes
2661
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
357 cmpa #%01000000 ; vwindow?
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
358 beq mode01
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
359 lbra IRQExit ; for now, bail
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
360
2661
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
361 * Virtual Window Handler
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
362 mode01
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
363 lda ,s
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
364 anda #%00110000
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
365 beq key
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
366 lbra IRQExit
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
367
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
368 key
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
369 lda ,s
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
370 anda #$0F
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
371 ora #$10
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
372 ifgt Level-1
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
373 ldx <D.DWStat
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
374 else
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
375 ldx >D.DWStat
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
376 endc
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
377 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
378 ; leax DW.StatTbl,x
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
379 lda a,x
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
380 clrb
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
381 tfr d,u
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
382 puls d
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
383 lbra IRQPutch
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
384
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
385
9e9ed6d6b4c2 Updated so that scdwn handles SS.Montr
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2640
diff changeset
386 * Virtual Serial Handler
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
387 mode00 lda ,s ; restore A
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
388 anda #$0F ; mask first 4 bits, a is now port #+1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
389 beq IRQCont ; if we're here with 0 in the port, its not really a port # (can we jump straight to status?)
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
390 deca ; we pass +1 to use 0 for no data
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
391 ; here we set U to the static storage area of the device we are working with
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
392 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
393 ldx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
394 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
395 ldx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
396 endc
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
397 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
398 ; leax DW.StatTbl,x
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
399 lda a,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
400 bne IRQCont ; if A is 0, then this device is not active, so exit
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
401 puls d
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
402 lbra IRQExit
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
403 IRQCont
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
404 clrb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
405 tfr d,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
406
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
407 puls d
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
408
2311
b2bc1ad04163 Made changes
aaronwolfe
parents: 2308
diff changeset
409 * multiread/status flag is in bit 4 of A
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
410 bita #$10
2702
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
411 lbeq IRQPutch ; branch for read1 if multiread not set
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
412
2311
b2bc1ad04163 Made changes
aaronwolfe
parents: 2308
diff changeset
413 * all 0s in port means status, anything else is multiread
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
414
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
415 bita #$0F ;mask bit 7-4
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
416 beq dostat ;port # all 0, this is a status response
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
417 lbra IRQMulti ;its not all 0, this is a multiread
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
418
2314
5f76d1a611f6 term signal sending for serread port status responses
aaronwolfe
parents: 2313
diff changeset
419
5f76d1a611f6 term signal sending for serread port status responses
aaronwolfe
parents: 2313
diff changeset
420 * in status events, databyte is split, 4bits status, 4bits port #
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
421 dostat bitb #$F0 ;mask low bits
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
422 lbne IRQExit ;we only implement code 0000, term
2314
5f76d1a611f6 term signal sending for serread port status responses
aaronwolfe
parents: 2313
diff changeset
423 * set u to port #
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
424 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
425 ldx <D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
426 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
427 ldx >D.DWStat
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
428 endc
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
429 lda b,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
430 bne statcont ; if A is 0, then this device is not active, so exit
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
431 lbra IRQExit
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
432
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
433 * IRQ set freq routine
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
434 * sets freq and clears NOP counter
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
435 * a = desired IRQ freq
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
436 IRQsetFRQ pshs x ; preserve
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
437 ifgt Level-1
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
438 ldx <D.DWStat
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
439 else
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
440 ldx >D.DWStat
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
441 endc
2422
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
442 sta DW.VIRQPkt+Vi.Rst+1,x
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
443 * +++ BGP +++ added following line so that the counter (which was copied by
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
444 * clock before calling us) gets reset to the same value the reset value. Without
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
445 * this line, we get called again with the PRIOR Vi.Rst value.
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
446 sta DW.VIRQPkt+Vi.Cnt+1,x
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
447 clr DW.VIRQNOP,x
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
448 puls x
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
449 rts
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
450
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
451
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
452 * This routine roots through process descriptors in a queue and
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
453 * checks to see if the process has a path that is open to the device
2702
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
454 * represented by the static storage pointer in U. If so, set the Condem
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
455 * bit of the P$State of that process.
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
456 *
2699
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
457 * Note: we start with path 0 and continue until we get to either (a) the
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
458 * last path for that process or (b) a hit on the static storage that we
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
459 * are seeking.
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
460 *
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
461 * Entry: X = process descriptor to evaluate
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
462 * U = static storage of device we want to check against
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
463 RootThrough
2699
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
464 clrb
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
465 leay P$Path,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
466 pshs x
2699
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
467 loop cmpb #NumPaths
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
468 beq out
1c88a9bc6c8c Reworked to make the searching of the paths in a process more efficient
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2698
diff changeset
469 incb
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
470 lda ,y+
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
471 beq loop
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
472 pshs y
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
473 ifgt Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
474 ldx <D.PthDBT
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
475 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
476 ldx >D.PthDBT
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
477 endc
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
478 os9 F$Find64
2703
aa91dd03121d Fixed bug where ordering of pull was affecting routine
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2702
diff changeset
479 ldx PD.DEV,y
aa91dd03121d Fixed bug where ordering of pull was affecting routine
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2702
diff changeset
480 leax V$STAT,x
2700
772a16760499 Slight improvements
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2699
diff changeset
481 puls y
772a16760499 Slight improvements
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2699
diff changeset
482 bcs loop +BGP+ Jul 20, 2012: continue even if error in F$Find64
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
483
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
484 cmpu ,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
485 bne loop
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
486
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
487 ldx ,s
2702
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
488 lda P$State,x get state of recipient
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
489 ora #Condem set condemn bit
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2700
diff changeset
490 sta P$State,x and set it back
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
491
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
492 out puls x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
493 ldx P$Queue,x
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
494 bne RootThrough
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
495 rts
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
496
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
497 statcont clrb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
498 tfr d,u
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
499 * NEW: root through all process descriptors. if any has a path open to this
2703
aa91dd03121d Fixed bug where ordering of pull was affecting routine
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2702
diff changeset
500 * device, condem it
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
501 ldx <D.AProcQ
2383
b399116a3b5f Now we have a /N descriptor... and the code in scdwn.asm to handle it.
boisy
parents: 2375
diff changeset
502 beq dowaitq
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
503 bsr RootThrough
2383
b399116a3b5f Now we have a /N descriptor... and the code in scdwn.asm to handle it.
boisy
parents: 2375
diff changeset
504 dowaitq ldx <D.WProcQ
b399116a3b5f Now we have a /N descriptor... and the code in scdwn.asm to handle it.
boisy
parents: 2375
diff changeset
505 beq dosleepq
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
506 bsr RootThrough
2383
b399116a3b5f Now we have a /N descriptor... and the code in scdwn.asm to handle it.
boisy
parents: 2375
diff changeset
507 dosleepq ldx <D.SProcQ
2375
707480b7f0b0 Updated
boisy
parents: 2374
diff changeset
508 beq CkLPRC
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
509 bsr RootThrough
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2359
diff changeset
510
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
511 CkLPRC
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
512 lda <V.LPRC,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
513 beq IRQExit ; no last process, bail
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
514 ldb #S$HUP
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
515 os9 F$Send ; send signal, don't think we can do anything about an error result anyway.. so
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
516 bra CkSuspnd ; do we need to go check suspend?
2314
5f76d1a611f6 term signal sending for serread port status responses
aaronwolfe
parents: 2313
diff changeset
517
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
518 ; put byte B in port As buffer - optimization help from Darren Atkinson
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
519 IRQPutCh
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
520 ; set IRQ freq for bulk
2422
61778d4bb634 Updated source to use labels from os9defs
boisy
parents: 2387
diff changeset
521 lda PollSpd1,pcr
2387
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
522 lbsr IRQsetFRQ
8476556e5f0c dynamic ISR/poll frequency
aaronwolfe
parents: 2383
diff changeset
523 ldx RxBufPut,u ; point X to the data buffer
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
524
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
525 ; process interrupt/quit characters here
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
526 ; note we will have to do this in the multiread (ugh)
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
527 tfr b,a ; put byte in A
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
528 ldb #S$Intrpt
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
529 cmpa V.INTR,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
530 beq send@
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
531 ldb #S$Abort
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
532 cmpa V.QUIT,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
533 bne store
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
534 send@ lda V.LPRC,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
535 beq IRQExit
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
536 os9 F$Send
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
537 bra IRQExit
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
538
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
539 store
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
540 ; store our data byte
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
541 sta ,x+ ; store and increment buffer pointer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
542
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
543 ; adjust RxBufPut
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
544 cmpx RxBufEnd,u ; end of Rx buffer?
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
545 blo IRQSkip1 ; no, go keep laydown pointer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
546 ldx RxBufPtr,u ; get Rx buffer start address
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
547 IRQSkip1 stx RxBufPut,u ; set new Rx data laydown pointer
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
548
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
549 ; increment RxDatLen
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
550 inc RxDatLen,u
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
551
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
552 CkSSig
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
553 lda <SSigID,u ; send signal on data ready?
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
554 beq CkSuspnd
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
555 ldb <SSigSg,u ; else get signal code
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
556 os9 F$Send
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
557 clr <SSigID,u
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
558 bra IRQExit
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
559
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
560 ; check if we have a process waiting for data
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
561 CkSuspnd
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
562 lda <V.WAKE,u ; V.WAKE?
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
563 beq IRQExit ; no
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
564 clr <V.WAKE,u ; clear V.WAKE
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
565
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
566 ; wake up waiter for read
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
567 ifeq Level-1
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
568 ldb #S$Wake
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
569 os9 F$Send
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
570 else
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
571 clrb
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
572 tfr d,x ; copy process descriptor pointer
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
573 lda P$State,x ; get state flags
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
574 anda #^Suspend ; clear suspend state
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
575 sta P$State,x ; save state flags
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
576 endc
2308
b5f0c5326e7e Changes made to move ISR to dw3
boisy
parents: 2180
diff changeset
577
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
578 IRQExit
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
579 IRQExit2 puls cc,dp,pc ; restore interrupts cc,dp, return
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
580
2374
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
581 emod
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
582 eom equ *
895dec31461a Added back code to send S$HUP to V.LPRC
boisy
parents: 2372
diff changeset
583 end