annotate level1/modules/scdwn.asm @ 2356:b7aaa0b1b339

took out wildcard support for now
author boisy
date Mon, 18 Jan 2010 20:48:47 +0000
parents 16b98c4a836d
children bfb8eefc19e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
1 ********************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
2 * scdwn - CoCo DriveWire Network Driver
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
3 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
4 * $Id$
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
5 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
7 * Comment
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
9 * 1 2009/11/30 Aaron Wolfe
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
10 * Started
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
11 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
12 * 2009/12/28 Boisy G. Pitre
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
13 * Modified so that F$STime is called if we get an error on calling
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
14 * F$VIRQ (which means the clock module has not be initialized)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
15 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
16 * 2009/12/31 Boisy G. Pitre
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
17 * Fixed crash in Init where F$Link failure would not clean up stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
18 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
19 * 2010/01/03 Boisy G. Pitre
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
20 * Moved IRQ stuff into DW3 subroutine module
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
21
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
22 nam scdwn
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
23 ttl CoCo DriveWire Network Driver
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
24
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
25 ifp1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
26 use defsfile
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
27 use dwdefs.d
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
28 endc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
29
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
30
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
31 tylg set Drivr+Objct
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
32 atrv set ReEnt+Rev
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
33 rev set $00
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
34 edition set 1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
35
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
36 * Note: driver memory defined in dwdefs.d
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
37 mod eom,name,tylg,atrv,start,SCFDrvMemSz
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
38
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
39 * module info
2343
16b98c4a836d Added SHARE. bit to device driver and descriptor
boisy
parents: 2340
diff changeset
40 fcb UPDAT.+SHARE. ;driver access modes
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
41 name fcs /scdwn/ ;driver name
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
42 fcb edition ;driver edition
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
43
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
44 * dispatch calls
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
45 start equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
46 lbra Init
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
47 lbra Read
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
48 lbra Write
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
49 lbra GetStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
50 lbra SetStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
51
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
52 ***********************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
53 * Term
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
54 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
55 * shut down the driver.
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
56 * should close only the correct port, tell server to close the port,
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
57 * and remove irq handler when no ports are left
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
58 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
59 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
60 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
61 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
62 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
63 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
64 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
65 Term equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
66 lda <V.PORT+1,u ;get our port #
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
67 pshs a ;port # on stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
68 * clear statics table entry
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
69 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
70 ldx <D.DWStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
71 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
72 ldx >D.DWStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
73 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
74 beq tell
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
75 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
76 ; leax DW.StatTbl,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
77 clr a,x ;clear out
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
78
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
79 ; tell server
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
80 tell
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
81 lda #OP_SERTERM ; load command
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
82 pshs a ; command store on stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
83 leax ,s ; point X to stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
84 ldy #2 ; 2 bytes to send
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
85
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
86 pshs u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
87
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
88 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
89 ldu <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
90 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
91 ldu >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
92 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
93 beq nosub
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
94 jsr 6,u ; call DWrite
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
95
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
96 nosub
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
97 puls u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
98 leas 2,s ; clean 3 DWsub args from stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
99 clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
100 rts
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
101
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
102 ***********************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
103 * Init
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
104 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
105 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
106 * Y = address of device descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
107 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
108 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
109 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
110 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
111 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
112 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
113
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
114 Init equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
115
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
116 ; link to subroutine module
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
117 ; has the link already been done?
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
118 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
119 ldx <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
120 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
121 ldx >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
122 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
123 bne already ; if so, do not bother
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
124
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
125 pshs u ; preserve u since os9 link is coming up
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
126
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
127 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
128 ldx <D.Proc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
129 pshs x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
130 ldx <D.SysPrc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
131 stx <D.Proc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
132 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
133 clra
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
134
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
135 leax dw3name,pcr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
136 os9 F$Link
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
137 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
138 puls x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
139 stx <D.Proc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
140 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
141 bcs InitEx2
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
142 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
143 sty <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
144 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
145 sty >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
146 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
147 jsr ,y ; call DW init routine
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
148
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
149 puls u ; restore u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
150
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
151 already
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
152 ; tell DW we have a new port opening (port mode already on stack)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
153 ldb <V.PORT+1,u ; get our port #
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
154 lda #OP_SERINIT ; command
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
155 pshs d ; command + port # on stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
156 leax ,s ; point X to stack
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
157 ldy #2 ; # of bytes to send
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
158
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
159 pshs u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
160 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
161 ldu <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
162 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
163 ldu >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
164 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
165 jsr 6,u ; call DWrite
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
166 puls u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
167
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
168 ; set up local buffer
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
169 ldb #RxBufDSz ; default Rx buffer size
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
170 leax RxBuff,u ; default Rx buffer address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
171 stb RxBufSiz,u ; save Rx buffer size
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
172 stx RxBufPtr,u ; save Rx buffer address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
173 stx RxBufGet,u ; set initial Rx buffer input address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
174 stx RxBufPut,u ; set initial Rx buffer output address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
175 abx ; add buffer size to buffer start..
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
176 stx RxBufEnd,u ; save Rx buffer end address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
177
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
178 tfr u,d ; (A = high page of statics)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
179 puls b
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
180 puls b ; (B = port number)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
181 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
182 ldx <D.DWStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
183 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
184 ldx >D.DWStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
185 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
186 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
187 ; leax DW.StatTbl,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
188 sta b,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
189 InitEx equ *
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
190 rts
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
191 InitEx2
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
192 puls u
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
193 rts
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
194
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
195 ; drivewire info
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
196 dw3name fcs /dw3/
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
197
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
198
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
199 *****************************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
200 * Write
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
201 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
202 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
203 * A = character to write
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
204 * Y = address of path descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
205 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
206 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
207 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
208 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
209 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
210 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
211 Write equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
212 pshs a ; character to send on stack
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
213 ldb <V.PORT+1,u ; port number into B
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
214 lda #OP_SERWRITE ; put command into A
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
215 pshs d
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
216 leax ,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
217 ldy #$0003 ; 3 bytes to send.. ugh. need WRITEM (data mode)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
218 IFGT Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
219 ldu <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
220 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
221 ldu >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
222 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
223 jsr 6,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
224 WriteOK clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
225 WriteExit puls a,x,pc ; clean stack, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
226
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
227
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
228 NotReady comb
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
229 ldb #E$NotRdy
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
230 rts
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
231
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
232 *************************************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
233 * Read
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
234 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
235 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
236 * Y = address of path descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
237 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
238 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
239 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
240 * A = character read
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
241 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
242 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
243 *
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
244 Read equ *
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
245 * Check to see if there is a signal-on-data-ready set for this path.
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
246 * If so, we return a Not Ready error.
2337
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
247 lda <SSigID,u data ready signal trap set up?
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
248 bne NotReady yes, exit with not ready error
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
249 pshs cc,dp ; save IRQ/Carry status, system DP
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
250
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
251 ReadChr orcc #IntMasks ; mask interrupts
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
252
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
253 lda RxDatLen,u ; get our Rx buffer count
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
254 beq ReadSlp ; no data, go sleep while waiting for new Rx data...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
255
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
256 ; we have data waiting
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
257 deca ; one less byte in buffer
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
258 sta RxDatLen,u ; save new Rx data count
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
259
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
260 ldx RxBufGet,u ; current Rx buffer pickup position
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
261 lda ,x+ ; get Rx character, set up next pickup position
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
262
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
263 cmpx RxBufEnd,u ; end of Rx buffer?
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
264 blo ReadChr1 ; no, keep pickup pointer
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
265 ldx RxBufPtr,u ; get Rx buffer start address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
266 ReadChr1 stx RxBufGet,u ; set new Rx data pickup pointer
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
267
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
268 ; return to caller
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
269 puls cc,dp,pc ; recover IRQ/Carry status, system DP, return with character in A
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
270
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
271 ReadSlp equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
272
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
273 IFEQ Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
274 ReadSlp2 lda <V.BUSY,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
275 sta <V.WAKE,u ; store process id in this port's entry in the waiter table
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
276 lbsr Sleep0 ; sleep level 1 style
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
277 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
278 ReadSlp2 lda >D.Proc ; process descriptor address MSB
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
279 sta <V.WAKE,u ; save MSB in V.WAKE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
280 clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
281 tfr d,x ; process descriptor address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
282 IFNE H6309
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
283 oim #Suspend,P$State,x ; suspend
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
284 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
285 ldb P$State,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
286 orb #Suspend
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
287 stb P$State,x ; suspend
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
288 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
289 bsr Sleep1 ; sleep level 2 style
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
290 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
291
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
292 ; we have been awakened..
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
293
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
294 ; check for signals
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
295 ldx >D.Proc ; process descriptor address
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
296 ldb P$Signal,x ; pending signal for this process?
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
297 beq ChkState ; no, go check process state...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
298 cmpb #S$Peer ; (S$Peer or lower)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
299 bls ErrExit ; yes, go do it...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
300
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
301 ChkState equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
302 ; have we been condemned to die?
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
303 IFNE H6309
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
304 tim #Condem,P$State,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
305 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
306 ldb P$State,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
307 bitb #Condem
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
308 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
309 bne PrAbtErr ; yes, go do it...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
310
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
311 ; check that our waiter byte was cleared by ISR instance
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
312 tst <V.WAKE,u ; our waiter byte
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
313 beq ReadChr ; 0 = its our turn, go get a character
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
314 bra ReadSlp ; false alarm, go back to sleep
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
315
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
316 PrAbtErr ldb #E$PrcAbt ; set error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
317
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
318 ErrExit equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
319 IFNE H6309
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
320 oim #Carry,,s ; set carry
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
321 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
322 lda ,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
323 ora #Carry
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
324 sta ,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
325 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
326 puls cc,dp,pc ; restore CC, system DP, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
327
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
328 IFEQ Level-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
329 Sleep0 ldx #$0 ; sleep till ISR wakes us
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
330 bra TimedSlp
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
331 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
332
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
333 Sleep1 ldx #$1 ; just sleep till end of slice, we are suspended (level 2)
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
334 TimedSlp andcc #^Intmasks ; enable IRQs
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
335 os9 F$Sleep
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
336 clr <V.WAKE,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
337 rts ; return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
338
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
339
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
340 **********************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
341 * GetStat - heavily borrowed from sc6551
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
342 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
343 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
344 * A = function code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
345 * Y = address of path descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
346 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
347 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
348 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
349 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
350 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
351 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
352 GetStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
353 clrb ; default to no error...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
354 pshs cc,dp ; save IRQ/Carry status,system DP
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
355
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
356 ldx PD.RGS,y ; caller's register stack pointer
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
357 cmpa #SS.EOF
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
358 beq GSExitOK ; SCF devices never return EOF
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
359
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
360 cmpa #SS.Ready
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
361 bne Advertise ; next check
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
362
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
363 ; SS.Ready
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
364 lda RxDatLen,u ; get Rx data length
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
365 beq NRdyErr ; none, go report error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
366 sta R$B,x ; set Rx data available in caller's [B]
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
367 GSExitOK puls cc,dp,pc ; restore Carry status, system DP, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
368
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
369 NRdyErr ldb #E$NotRdy
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
370 bra ErrExit ; return error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
371
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
372 UnSvcErr ldb #E$UnkSvc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
373 bra ErrExit ; return error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
374
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
375 ; We advertise all of our SERGETSTAT calls (except SS.Ready) to the server
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
376 Advertise
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
377 ldb #OP_SERGETSTAT
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
378 bsr SendStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
379
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
380 ; Note: Here we could somehow obtain the size of the terminal window from the server
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
381 GetScSiz cmpa #SS.ScSiz
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
382 bne GetComSt ; next check
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
383 ldu PD.DEV,y
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
384 ldu V$DESC,u ; device descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
385 clra
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
386 ldb IT.COL,u ; return screen size
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
387 std R$X,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
388 ldb IT.ROW,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
389 std R$Y,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
390 puls cc,dp,pc ; restore Carry status, system DP, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
391
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
392 GetComSt cmpa #SS.ComSt
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
393 bne UnSvcErr ; no, we have no more answers, report error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
394 ldd #$0000 ; not used, return $0000
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
395 std R$Y,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
396 sta R$B,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
397 puls cc,dp,pc ; restore Carry status, system DP, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
398
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
399 * Advertise Stat Code to server
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
400 * A = Function Code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
401 * B = OP_SERGETSTAT or OP_SERSETSTAT
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
402 SendStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
403 ; advertise our GetStt code to the server
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
404 pshs a,y,x,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
405 leas -3,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
406 leax ,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
407 stb ,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
408 sta 2,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
409 ldb V.PORT+1,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
410 stb 1,x
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
411 ldy #$0003
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
412 IFGT LEVEL-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
413 ldu <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
414 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
415 ldu >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
416 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
417 jsr 6,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
418 leas 3,s
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
419 puls a,y,x,u,pc
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
420
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
421 *************************************************************************
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
422 * SetStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
423 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
424 * Entry:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
425 * A = function code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
426 * Y = address of path descriptor
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
427 * U = address of device memory area
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
428 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
429 * Exit:
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
430 * CC = carry set on error
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
431 * B = error code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
432 *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
433 SetStat
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
434 ldb #OP_SERSETSTAT
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
435 bsr SendStat
2338
a640af6b4582 More updates
boisy
parents: 2337
diff changeset
436 cmpa #SS.Open
a640af6b4582 More updates
boisy
parents: 2337
diff changeset
437 beq open
2340
9fa98dcb9721 added SS.Close
boisy
parents: 2339
diff changeset
438 cmpa #SS.Close
9fa98dcb9721 added SS.Close
boisy
parents: 2339
diff changeset
439 beq ex
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
440 cmpa #SS.ComSt
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
441 beq comst
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
442 cmpa #SS.SSig
2337
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
443 beq ssig
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
444 cmpa #SS.Relea
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
445 lbne donebad
2337
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
446 relea lda PD.CPR,y get curr proc #
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
447 cmpa <SSigID,u same?
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
448 bne ex
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
449 clr <SSigID,u clear process id
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
450 ex rts
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
451 ssig pshs cc
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
452 orcc #IntMasks
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
453 lda PD.CPR,y ; get curr proc #
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
454 ldx PD.RGS,y
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
455 ldb R$X+1,x ; get user signal code
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
456 tst RxDatLen,u ; get Rx data length
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
457 beq ssigsetup ; branch if no data in buffer
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
458 * if here, we have data so send signal immediately
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
459 os9 F$Send
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
460 puls cc,pc
2337
75e4303de24c Fixed issue with wrong offset into ssig stuff
boisy
parents: 2333
diff changeset
461 ssigsetup std <SSigID,u ; save process ID & signal
2333
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
462 puls cc,pc
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
463
080b3670b08f Updated to handle SSig on data ready
boisy
parents: 2324
diff changeset
464 comst leax PD.OPT,y
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
465 ldy #OPTCNT
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
466 IFGT LEVEL-1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
467 ldu <D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
468 ELSE
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
469 ldu >D.DWSubAddr
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
470 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
471 jsr 6,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
472 clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
473 rts
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
474
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
475 * SS.Open processor
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
476 * Entry: X=Register stack pointer
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
477 * Y=Path descriptor pointer
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
478 * U=Static memory pointer
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
479 open pshs u,y
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
480 tst <V.PORT+1,u check if this is $FF00 (wildcard)
2356
b7aaa0b1b339 took out wildcard support for now
boisy
parents: 2343
diff changeset
481 bra openex
b7aaa0b1b339 took out wildcard support for now
boisy
parents: 2343
diff changeset
482 * bne openex
2338
a640af6b4582 More updates
boisy
parents: 2337
diff changeset
483 * wildcard /N device... search for free device
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
484 IFGT Level-1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
485 ldx <D.DWStat
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
486 ELSE
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
487 ldx >D.DWStat
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
488 ENDC
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
489 ; cheat: we know DW.StatTbl is at offset $00 from D.DWStat, do not bother with leax
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
490 ; leax DW.StatTbl,x
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
491 clrb
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
492 next tst ,x+
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
493 beq found
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
494 incb
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
495 cmpb #DW.StatCnt-1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
496 blt next
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
497 comb
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
498 ldb #E$MNF failed to find device
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
499 openex puls y,u,pc
2338
a640af6b4582 More updates
boisy
parents: 2337
diff changeset
500
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
501 * we have found a free device (B holds #), build name, link it, then
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
502 * put into device table
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
503 found
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
504 * build name
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
505 leas -4,s
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
506 leax ,s
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
507 lda #'N
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
508 sta ,x+
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
509 * take byte in B and turn into ASCII string at X
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
510 lda #'0
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
511 cmpb #9
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
512 bls lo1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
513 lo10 subb #10
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
514 bcs hi10
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
515 inca
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
516 bra lo10
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
517 hi10 addb #10
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
518 sta ,x+
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
519 lda #'0
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
520 lo1 decb
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
521 bmi hi1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
522 inca
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
523 bra lo1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
524 hi1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
525 * terminate with CR
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
526 ldb #13
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
527 std ,x
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
528 * switch to system process descriptor
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
529 IFGT Level-1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
530 ldd <D.Proc Get current process dsc. ptr
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
531 pshs d Save on stack
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
532 ldd <D.SysPrc Get system process dsc. ptr
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
533 std <D.Proc Make it the current process
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
534 ENDC
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
535 * link device
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
536 leax 2,s
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
537 lda #Devic+Objct get module type
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
538 os9 F$Link try & link it
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
539 IFGT Level-1
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
540 puls y
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
541 * switch back to current process descriptor
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
542 sty <D.Proc Make it the current process
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
543 ENDC
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
544 leas 4,s restore stack
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
545 bcs openex
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
546 * if no error on link, manipulate device table
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
547 * Got a device descriptor, put into device table & save window # into static
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
548 ldy ,s get path descriptor pointer
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
549 ldx PD.DEV,y get pointer to device table
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
550 stu V$DESC,x save pointer to descriptor into it
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
551 os9 F$UnLink unlink it from system map
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
552 bra openex
2338
a640af6b4582 More updates
boisy
parents: 2337
diff changeset
553
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
554 IFEQ 1
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
555 SetPortSig
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
556 cmpa #SS.PortSig
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
557 bne SetPortRel
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
558 lda PD.CPR,y current process ID
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
559 ldb R$X+1,x LSB of [X] is signal code
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
560 std <PortSigPID
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
561 clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
562 rts
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
563 SetPortRel
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
564 cmpa #SS.PortRel
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
565 bne donebad
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
566 leax PortSigPID,u
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
567 bsr ReleaSig
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
568 clrb
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
569 rts
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
570 ENDC
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
571 donebad comb
2339
f9ff11331a2f Changes made to scdwn now send 2 bytes at INIT... server should get mode
boisy
parents: 2338
diff changeset
572 ldb #E$UnkSvc
2324
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
573 rts
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
574
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
575 ReleaSig pshs cc save IRQ enable status
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
576 orcc #IntMasks disable IRQs while releasing signal
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
577 lda PD.CPR,y get current process ID
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
578 suba ,x same as signal process ID?
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
579 bne NoReleas no, go return...
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
580 sta ,x clear this signal's process ID
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
581 NoReleas puls cc,pc restore IRQ enable status, return
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
582
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
583 emod
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
584 eom equ *
ccd33b48321a Renamed scdwt to scdwn, t/u to n descriptors
boisy
parents:
diff changeset
585 end