[Copyright 1999,2002 Frank Durda IV, All Rights Reserved. Mirroring of any material on this page in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_software_2011 at nemesis.lonestar.org]
MISOSYS EDAS-4.3 04/11/99 02:28:45 SET/FILTER - LS-DOS 6.2 Page 00001
00001 ;LBSET/ASM - Set and Filter commands
00003 ;
000D 00004 CR EQU 13
0000 00005 *GET SVCMAC:3 ;SVC Macro equivalents
00006 ;SVCMAC/ASM - LS-DOS Version VI
00007 *LIST OFF
00399 *LIST ON
00401 ;
00402 ; ORG this up here to allow driver programs to
00403 ; load at X'2400' without clobbering this program
00404 ;
2C00 00405 ORG 2C00H
00406 ;
00407 ; FILTER entry point
00408 ;
2C00 C3B22C 00409 JP FILTER ;Filter entry point
00410 ;
00411 ; SET entry point
00412 ;
2C03 00413 SET @@FLAGS ;Flag table pointer
2C03+3E65 00414 LD A,101
2C05+EF 00415 RST 40
2C06 FDCB0246 00416 BIT 0,(IY+'C'-'A') ;Can't use if memory
2C0A C2272D 00417 JP NZ,CANT ; is frozen
2C0D 11CD2D 00418 LD DE,DEVFCB ;Get filespec
2C10 00419 @@FSPEC
2C10+3E4E 00420 LD A,78
2C12+EF 00421 RST 40
2C13 C2232D 00422 JP NZ,DEVREQ ;Quit if bad name
2C16 1A 00423 LD A,(DE) ;Ck on devicespec
2C17 FE2A 00424 CP '*'
2C19 C2232D 00425 JP NZ,DEVREQ ;Must have device
2C1C 11ED2D 00426 LD DE,PGMFCB ;Get driver or filter
2C1F 00427 @@FSPEC ; filespec
2C1F+3E4E 00428 LD A,78
2C21+EF 00429 RST 40
2C22 C22B2D 00430 JP NZ,SPCREQ ;Must be entered
2C25 1A 00431 LD A,(DE) ;Target cannot be device
2C26 FE2A 00432 CP '*' ; since this is SET
2C28 CA2B2D 00433 JP Z,SPCREQ
2C2B E5 00434 PUSH HL ;Save INBUF$ pointer
2C2C D5 00435 PUSH DE ; and FCB start
2C2D 21AD2D 00436 LD HL,SAVSPEC ;Save the filter/driver
2C30 EB 00437 EX DE,HL ; filespec to try /DVR
2C31 012000 00438 LD BC,32 ; if /FLT is not found
2C34 EDB0 00439 LDIR
2C36 D1 00440 POP DE ;Recover FCB
2C37 210B2D 00441 LD HL,FLTEXT ;Default extension is FLT
2C3A 00442 @@FEXT ;Use default EXT if none
2C3A+3E4F 00443 LD A,79
2C3C+EF 00444 RST 40
2C3D E1 00445 POP HL ;Recover cmdline posn
00446 ;
00447 ; Make sure device is not in system
00448 ;
2C3E E5 00449 PUSH HL ;Save INBUF$ pointer
2C3F ED5BCE2D 00450 LD DE,(DEVFCB+1) ;P/u device name
2C43 00451 @@GTDCB ;Find device DCB address
2C43+3E52 00452 LD A,82
2C45+EF 00453 RST 40
2C46 2016 00454 JR NZ,NEWDCB ;Go if not found
2C48 CB5E 00455 BIT 3,(HL) ; else check if NIL
2C4A 3E27 00456 LD A,39 ;Init "Device in use...
2C4C 2840 00457 JR Z,ERRPOP ;Error if not NIL
00458 ;
00459 ; Inhibit SETting any system device
00460 ;
2C4E E5 00461 PUSH HL ;Save DCB pointer
2C4F 21CD2D 00462 LD HL,DEVFCB ;Determine if system
2C52 54 00463 LD D,H ; device by attempting
2C53 5D 00464 LD E,L ; to rename it
2C54 00465 @@RENAM ;The error code will be
2C54+3E38 00466 LD A,56
2C56+EF 00467 RST 40
2C57 E1 00468 POP HL ; either 19 or 40
2C58 FE28 00469 CP 40 ;Protected system device?
2C5A 2832 00470 JR Z,ERRPOP
2C5C 180A 00471 JR GOTDCB ; else we have it
00472 ;
00473 ; Device not found - Locate spare DCB
00474 ;
2C5E 110000 00475 NEWDCB LD DE,0 ;Find spare device
2C61 00476 @@GTDCB ; table position
2C61+3E52 00477 LD A,82
2C63+EF 00478 RST 40
2C64 3E21 00479 LD A,33 ;"no device space avail
2C66 2026 00480 JR NZ,ERRPOP ;Exit on error
00481 ;
00482 ; DCB available - Load the driver/filter
00483 ;
2C68 E5 00484 GOTDCB PUSH HL ;Save table address
2C69 FDCB12D6 00485 SET 2,(IY+'S'-'A') ;Allow use with EXEC only
2C6D 11ED2D 00486 LD DE,PGMFCB ;Load the target file
2C70 00487 @@LOAD ;Transfer address in HL
2C70+3E4C 00488 LD A,76
2C72+EF 00489 RST 40
2C73 281D 00490 JR Z,LOADOK ;Go if file found
2C75 E63F 00491 AND 3FH ;Strip flags
2C77 FE1F 00492 CP 31 ;Program not found?
2C79 2012 00493 JR NZ,LOADERR ;Abort on any other
00494 ;
00495 ; No FILTER found - Check on DRIVER
00496 ;
2C7B 11AD2D 00497 LD DE,SAVSPEC ;Original filename
2C7E 210E2D 00498 LD HL,DVREXT ;Try with /DVR
2C81 00499 @@FEXT
2C81+3E4F 00500 LD A,79
2C83+EF 00501 RST 40
2C84 FDCB12D6 00502 SET 2,(IY+'S'-'A') ;Allow use with EXEC only
2C88 00503 @@LOAD
2C88+3E4C 00504 LD A,76
2C8A+EF 00505 RST 40
2C8B 2805 00506 JR Z,LOADOK ;Go if file found
2C8D E1 00507 LOADERR POP HL ;Clean the stack
2C8E E1 00508 ERRPOP POP HL
2C8F C3112D 00509 JP IOERR ;Abort on load error
00510 ;
00511 ; Move device name into string buffer
00512 ;
2C92 D1 00513 LOADOK POP DE ;Rcvr table address
2C93 D5 00514 PUSH DE
2C94 F3 00515 DI ;Don't interrupt me
2C95 3E08 00516 LD A,8 ;Set up as NIL first
2C97 12 00517 LD (DE),A
2C98 1C 00518 NOSET INC E ;Transfer device name
2C99 1C 00519 INC E ; entered in command
2C9A 1C 00520 INC E ; to the device table
2C9B 3E08 00521 LD A,8 ;Show RESET as NIL
2C9D 12 00522 LD (DE),A
2C9E 1C 00523 INC E
2C9F 1C 00524 INC E ;Point to name field
2CA0 1C 00525 INC E
2CA1 3ACE2D 00526 LD A,(DEVFCB+1) ;Move name to DCB
2CA4 12 00527 LD (DE),A
2CA5 1C 00528 INC E
2CA6 3ACF2D 00529 LD A,(DEVFCB+2)
2CA9 12 00530 LD (DE),A
2CAA FB 00531 EI ;Interrupts back on
2CAB D1 00532 GODOIT POP DE ;Recover DCB address
2CAC E3 00533 EX (SP),HL ;Stack prog's TRAADR
2CAD FDCB02DE 00534 SET 3,(IY+'C'-'A') ;Set system request
2CB1 C9 00535 RET ; & go to it
00536 ;
00537 ; FILTER *dev *dev routine
00538 ;
2CB2 11CD2D 00539 FILTER LD DE,DEVFCB ;Get first spec
2CB5 00540 @@FSPEC
2CB5+3E4E 00541 LD A,78
2CB7+EF 00542 RST 40
2CB8 C2232D 00543 JP NZ,DEVREQ ;Quit on bad name
2CBB 1A 00544 LD A,(DE) ;Ck on devicespec
2CBC FE2A 00545 CP '*'
2CBE C2232D 00546 JP NZ,DEVREQ ;Must have device
2CC1 11ED2D 00547 LD DE,PGMFCB ;Get filter device spec
2CC4 00548 @@FSPEC
2CC4+3E4E 00549 LD A,78
2CC6+EF 00550 RST 40
2CC7 C22B2D 00551 JP NZ,SPCREQ ;Must be entered
2CCA 1A 00552 LD A,(DE) ;Target must be a device
2CCB FE2A 00553 CP '*' ; since this is FILTER
2CCD C2232D 00554 JP NZ,DEVREQ
2CD0 ED5BEE2D 00555 LD DE,(PGMFCB+1) ;Get filter DCB address
2CD4 00556 @@GTDCB
2CD4+3E52 00557 LD A,82
2CD6+EF 00558 RST 40
2CD7 2038 00559 JR NZ,IOERR ;Quit if not found
2CD9 CB76 00560 BIT 6,(HL) ;Must be a filter
2CDB 2842 00561 JR Z,NOTFLT ;Quit if not
00562 ;
00563 ; FILTER must be inactive to use it
00564 ;
2CDD 54 00565 LD D,H ;Xfer FILTER DCB pointer
2CDE 5D 00566 LD E,L ; to DE & locate the
2CDF 2C 00567 INC L ; DCB pointer in the
2CE0 7E 00568 LD A,(HL) ; the FILTER module
2CE1 2C 00569 INC L
2CE2 66 00570 LD H,(HL)
2CE3 6F 00571 LD L,A
2CE4 010400 00572 LD BC,4 ;HL now points to the
2CE7 09 00573 ADD HL,BC ; entry point. Get its
2CE8 4E 00574 LD C,(HL) ; DCB address by peeking
2CE9 0C 00575 INC C ; past the name field
2CEA 09 00576 ADD HL,BC
2CEB 7E 00577 LD A,(HL) ;Get low-order
2CEC 23 00578 INC HL
2CED 66 00579 LD H,(HL) ;Get hi-order
2CEE 6F 00580 LD L,A
00581 ;If DCB is NOT pointing
2CEF ED52 00582 SBC HL,DE ; to itself, then it
2CF1 2028 00583 JR NZ,ACTFLT ; is an active filter
00584 ;
00585 ; The filter DCB pointer points to its DCB
00586 ;
2CF3 D5 00587 PUSH DE ;Save filter DCB
2CF4 ED5BCE2D 00588 LD DE,(DEVFCB+1) ;Find the device DCB
2CF8 00589 @@GTDCB
2CF8+3E52 00590 LD A,82
2CFA+EF 00591 RST 40
2CFB D1 00592 POP DE
2CFC 2013 00593 JR NZ,IOERR ;Quit if not found
00594 ;
00595 ; Swap the 1st three bytes of DCB & FILT DCB
00596 ;
2CFE 0603 00597 LD B,3
2D00 4E 00598 SWAP LD C,(HL)
2D01 1A 00599 LD A,(DE)
2D02 77 00600 LD (HL),A
2D03 79 00601 LD A,C
2D04 12 00602 LD (DE),A
2D05 2C 00603 INC L
2D06 1C 00604 INC E
2D07 10F7 00605 DJNZ SWAP
2D09 182A 00606 JR EXIT
00607 ;
2D0B 46 00608 FLTEXT DB 'FLT'
4C 54
2D0E 44 00609 DVREXT DB 'DVR'
56 52
00610 ;
2D11 6F 00611 IOERR LD L,A ;Transfer error code
2D12 2600 00612 LD H,0 ; to HL
2D14 F6C0 00613 OR 0C0H ;Set abbrev & return
2D16 4F 00614 LD C,A
2D17 00615 @@ERROR
2D17+3E1A 00616 LD A,26
2D19+EF 00617 RST 40
2D1A C9 00618 RET
00619 ;
2D1B 21952D 00620 ACTFLT LD HL,ACTFLT$
2D1E DD 00621 DB 0DDH
2D1F 217E2D 00622 NOTFLT LD HL,NOTFLT$
2D22 DD 00623 DB 0DDH
2D23 214F2D 00624 DEVREQ LD HL,DEVREQ$
2D26 DD 00625 DB 0DDH
2D27 21642D 00626 CANT LD HL,CANT$
2D2A DD 00627 DB 0DDH
2D2B 213C2D 00628 SPCREQ LD HL,SPCREQ$
2D2E 00629 @@LOGOT
00630 IFEQ 00H,1
00631 LD HL,
00632 ENDIF
2D2E+3E0C 00633 LD A,12
2D30+EF 00634 RST 40
2D31 21FFFF 00635 LD HL,-1
2D34 C9 00636 RET
00637 ;
2D35 210000 00638 EXIT LD HL,0
2D38 00639 @@CKBRKC ;Clear out break
2D38+3E6A 00640 LD A,106
2D3A+EF 00641 RST 40
2D3B C9 00642 RET
00643 ;
2D3C 46 00644 SPCREQ$ DB 'File spec required',CR
69 6C 65 20 73 70 65 63
20 72 65 71 75 69 72 65
64 0D
2D4F 44 00645 DEVREQ$ DB 'Device spec required',CR
65 76 69 63 65 20 73 70
65 63 20 72 65 71 75 69
72 65 64 0D
2D64 4E 00646 CANT$ DB 'No memory space available',CR
6F 20 6D 65 6D 6F 72 79
20 73 70 61 63 65 20 61
76 61 69 6C 61 62 6C 65
0D
2D7E 44 00647 NOTFLT$ DB 'Device is not a filter',CR
65 76 69 63 65 20 69 73
20 6E 6F 74 20 61 20 66
69 6C 74 65 72 0D
2D95 46 00648 ACTFLT$ DB 'FILTER module is in use',CR
49 4C 54 45 52 20 6D 6F
64 75 6C 65 20 69 73 20
69 6E 20 75 73 65 0D
00649 ;
2DAD 00650 SAVSPEC DS 32
2DCD 00651 DEVFCB DS 32 ;Device file control block
2DED 00652 PGMFCB DS 32 ;Driver/filter FCB
00653 ;
2C03 00654 END SET
2C03 is the transfer address
00000 Total errors
[Copyright 1999,2002 Frank Durda IV, All Rights Reserved. Mirroring of any material on this page in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_software_2011 at nemesis.lonestar.org]