Mercurial > hg > Members > kono > nitros9-code
comparison level1/modules/scdwn.asm @ 2333:080b3670b08f
Updated to handle SSig on data ready
author | boisy |
---|---|
date | Wed, 13 Jan 2010 12:45:50 +0000 |
parents | ccd33b48321a |
children | 75e4303de24c |
comparison
equal
deleted
inserted
replaced
2332:594d292e1788 | 2333:080b3670b08f |
---|---|
226 jsr 6,u | 226 jsr 6,u |
227 WriteOK clrb | 227 WriteOK clrb |
228 WriteExit puls a,x,pc ; clean stack, return | 228 WriteExit puls a,x,pc ; clean stack, return |
229 | 229 |
230 | 230 |
231 NotReady comb | |
232 ldb #E$NotRdy | |
233 rts | |
234 | |
231 ************************************************************************************* | 235 ************************************************************************************* |
232 * Read | 236 * Read |
233 * | 237 * |
234 * Entry: | 238 * Entry: |
235 * Y = address of path descriptor | 239 * Y = address of path descriptor |
238 * Exit: | 242 * Exit: |
239 * A = character read | 243 * A = character read |
240 * CC = carry set on error | 244 * CC = carry set on error |
241 * B = error code | 245 * B = error code |
242 * | 246 * |
243 Read equ * | 247 Read equ * |
248 * Check to see if there is a signal-on-data-ready set for this path. | |
249 * If so, we return a Not Ready error. | |
250 lda <V.SSigID,u data ready signal trap set up? | |
251 bne NotReady yes, exit with not ready error | |
252 | |
244 pshs cc,dp ; save IRQ/Carry status, system DP | 253 pshs cc,dp ; save IRQ/Carry status, system DP |
245 | 254 |
246 ReadChr orcc #IntMasks ; mask interrupts | 255 ReadChr orcc #IntMasks ; mask interrupts |
247 | 256 |
248 lda RxDatLen,u ; get our Rx buffer count | 257 lda RxDatLen,u ; get our Rx buffer count |
249 beq ReadSlp ; no data, go sleep while waiting for new Rx data... | 258 beq ReadSlp ; no data, go sleep while waiting for new Rx data... |
250 | 259 |
251 ; we have data waiting | 260 ; we have data waiting |
427 * | 436 * |
428 SetStat | 437 SetStat |
429 ldb #OP_SERSETSTAT | 438 ldb #OP_SERSETSTAT |
430 bsr SendStat | 439 bsr SendStat |
431 cmpa #SS.ComSt | 440 cmpa #SS.ComSt |
441 beq comst | |
442 cmpa #SS.SSig | |
432 bne donebad | 443 bne donebad |
433 leax PD.OPT,y | 444 ssig pshs cc |
445 orcc #IntMasks | |
446 lda PD.CPR,y ; get curr proc # | |
447 ldx PD.RGS,y | |
448 ldb R$X+1,x ; get user signal code | |
449 tst RxDatLen,u ; get Rx data length | |
450 beq ssigsetup ; branch if no data in buffer | |
451 * if here, we have data so send signal immediately | |
452 os9 F$Send | |
453 puls cc,pc | |
454 ssigsetup std <V.SSigID,u ; save process ID & signal | |
455 puls cc,pc | |
456 | |
457 comst leax PD.OPT,y | |
434 ldy #OPTCNT | 458 ldy #OPTCNT |
435 IFGT LEVEL-1 | 459 IFGT LEVEL-1 |
436 ldu <D.DWSubAddr | 460 ldu <D.DWSubAddr |
437 ELSE | 461 ELSE |
438 ldu >D.DWSubAddr | 462 ldu >D.DWSubAddr |