LS-DOS 6.3.1 - FLOPPY Driver Utility Assembly Listing (HTML format version)

[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/19/99 21:42:53 FLOPPY/DCT - LS-DOS 6.2      Page 00001 

              00001 ;LDOSDCT/ASM - Floppy Disk DCT
              00003 ;
              00004 ;       Program installs a standard DCT into a logical
              00005 ;       drive slot as specified by:
              00006 ;        SYSTEM (DRIVE=d,DRIVER="LDOS")
              00007 ;       The default DCT is taken from slot 0 of the
              00008 ;       System Information Sector (70H-79H).
              00009 ;
000D          00010 CR      EQU     13
000A          00011 LF      EQU     10
              00012 ;
0000          00013 *GET    SVCMAC:3                ;SVC Macro equivalents
              00014 ;SVCMAC/ASM - LS-DOS Version VI
              00015 *LIST   OFF
              00407 *LIST   ON
0000          00409 *GET    COPYCOM:3               ;Copyright message
              00410 ; COPYCOM - File for Copyright COMment block
              00411 ;
0000          00412 *GET BUILDVER/ASM:3
              00413 ;
              00414 ;       Buildver/asm is a bit of a kludge since not all utilities can load
              00415 ;       equates from LDOS60 and still compile.  LOWCORE and everybody else
              00416 ;       relies on this setting, and it eventually ends up in LDOS60/EQU
              00417 ;       for programs that can use that.
              00418 ;
FFFF          00419 @BLD631         EQU     -1      ;<631>Build 631 distribution (LEVEL 1B)
              00420 ;       These switches activate patches made since the 1B release.
              00421 ;       It is important that all earlier patches be enabled when a higher
              00422 ;       patch is enabled.
              00423 ;       Patches C thru F were published in TMQ IV.iv, page 32 (NOTE: the
              00424 ;       patch addresses listed for SPOOL in SPOOL1/FIX are 19H high.)
FFFF          00425 @BLD631C        EQU     -1      ;<631>Apply 1C patches (SETKI)
FFFF          00426 @BLD631D        EQU     -1      ;<631>Apply 1D patches (DIR)
FFFF          00427 @BLD631E        EQU     -1      ;<631>Apply 1E patches (DIR & MEMDISK/DCT)
FFFF          00428 @BLD631F        EQU     -1      ;<631>Apply 1F patches (SPOOL)
              00429 ;       Patches G and H were published in TMQ V.i, pages 10 and 18/19.
FFFF          00430 @BLD631G        EQU     -1      ;<631>Apply 1G patches (//KEYIN,DIR,DO *)
FFFF          00431 @BLD631H        EQU     -1      ;<631>Apply 1H patches (MEMORY)
              00432 ;
              00433 ;End of BUILDVER/ASM
              00434         IF      @BLD631
              00436         ELSE
              00437         COM     '<*(C) 1982,3,4,6 by LSI*>'
              00438         ENDIF
              00439 ;
              00440         IF      @BLD631
2400          00441         ORG     2400H           ;<631>
              00442         ELSE
              00443         ORG     2C00H
              00444         ENDIF
              00445 ;
              00446 BEGIN
2400          00447         @@CKBRKC
2400+3E6A     00448         LD      A,106
2402+EF       00449         RST     40
2403 2804     00450         JR      Z,BEGINA        ;Continue if no break
2405 21FFFF   00451         LD      HL,-1           ; else abort
2408 C9       00452         RET
              00453 ;
2409 D5       00454 BEGINA  PUSH    DE              ;Save the DCT location
240A          00455         @@DSPLY HELLO$          ;Display the signon
              00456         IFEQ    01H,1
240A+21F924   00457         LD      HL,HELLO$
              00458         ENDIF
240D+3E0A     00459         LD      A,10
240F+EF       00460         RST     40
2410 D1       00461         POP     DE
2411 7A       00462 LDOS    LD      A,D             ;Make sure that a
2412 B3       00463         OR      E               ;  drive # was entered
2413 CAE824   00464         JP      Z,NODRV         ;Go if no drive
              00465 ;
              00466 ;       Check if entry from SET command
              00467 ;
2416          00468         @@FLAGS
2416+3E65     00469         LD      A,101
2418+EF       00470         RST     40
2419 FDCB025E 00471         BIT     3,(IY+'C'-'A')  ;System request?
241D CADC24   00472         JP      Z,VIASET        ;Exit if not
2420 1A       00473         LD      A,(DE)
2421 FEC9     00474         CP      0C9H            ;Is drive disabled?
2423 C2E024   00475         JP      NZ,ACTIVE       ;Must be disabled
2426 D5       00476         PUSH    DE              ;Save DCT address
2427 111626   00477         LD      DE,FDCNAM$      ;Pt to module name
242A          00478         @@GTMOD                 ;Be sure floppy driver here
242A+3E53     00479         LD      A,83
242C+EF       00480         RST     40
242D C2EC24   00481         JP      NZ,NODVR        ;Go if not
2430 22A424   00482         LD      (DVRADR),HL     ;Save floppy dvr addr
2433 CDC424   00483         CALL    GETCFG          ;Load sysinfo sector
2436 C2CF24   00484         JP      NZ,IOERR        ;Quit on read error
2439 FDCB0B66 00485         BIT     4,(IY+'L'-'A')  ;Suppress 8" queries?
243D 201C     00486         JR      NZ,LDOS3        ;NZ=suppress
              00487 ;
              00488 ;       Query as to 5" or 8" floppy
              00489 ;
243F 211A26   00490 DRVTYP  LD      HL,DRVTYP$      ;"Enter drive code...
2442          00491         @@DSPLY
              00492         IFEQ    00H,1
              00493         LD      HL,
              00494         ENDIF
2442+3E0A     00495         LD      A,10
2444+EF       00496         RST     40
2445 217026   00497         LD      HL,BUF          ;Pt to buffer
2448 010001   00498         LD      BC,1<8          ;Allow 1 char only
244B          00499         @@KEYIN                 ;Get response
244B+3E09     00500         LD      A,9
244D+EF       00501         RST     40
244E DAE424   00502         JP      C,BREAK         ;Quit on Break
2451 7E       00503         LD      A,(HL)          ;P/u char response
2452 D630     00504         SUB     '0'             ;Adjust to binary
2454 FE02     00505         CP      2               ;Make sure requested
2456 30E7     00506         JR      NC,DRVTYP       ;  type is supported
2458 327E24   00507         LD      (LX805+1),A
              00508 ;
              00509 ;       Prompt user for physical drive address
              00510 ;
245B          00511 LDOS3   @@DSPLY DRVADR$         ;"Enter physical...
              00512         IFEQ    01H,1
245B+213E26   00513         LD      HL,DRVADR$
              00514         ENDIF
245E+3E0A     00515         LD      A,10
2460+EF       00516         RST     40
2461 217026   00517         LD      HL,BUF          ;Input buffer
2464 010001   00518         LD      BC,1<8          ;Allow 1 char only
2467          00519         @@KEYIN                 ;Get response
2467+3E09     00520         LD      A,9
2469+EF       00521         RST     40
246A DAE424   00522         JP      C,BREAK         ;Quit on Break
246D 7E       00523         LD      A,(HL)          ;P/u the response
246E D631     00524         SUB     '1'             ;Adjust to binary
2470 FE04     00525         CP      3+1             ;Be sure in range
2472 30E7     00526         JR      NC,LDOS3        ;Redo if not
              00527 ;
              00528 ;       Convert drive address to select code
              00529 ;
2474 FE03     00530         CP      3               ;Convert 3 to 4
2476 3F       00531         CCF
2477 CE00     00532         ADC     A,0
2479 FE01     00533         CP      1               ;Convert <0,1,2,4>
247B 17       00534         RLA                     ;  to <1, 2, 4, 8>
247C 47       00535         LD      B,A             ;Hang on to request
              00536 ;
              00537 ;       Index the default drive code table
              00538 ;
247D          00539 LX805   EQU     $
              00540         IF      @MOD2
              00541         LD      A,1             ;8"
              00542         ENDIF
              00543         IF      @MOD4
247D 3E00     00544         LD      A,0             ;5"
              00545         ENDIF
247F 4F       00546         LD      C,A
2480 87       00547         ADD     A,A             ;Times 2
2481 81       00548         ADD     A,C             ;Times 3
2482 87       00549         ADD     A,A             ;Times 6
2483 81       00550         ADD     A,C             ;Times 7
2484 216226   00551         LD      HL,DRVTAB$      ;Index into 5" or 8"
2487 85       00552         ADD     A,L             ;  default table
2488 6F       00553         LD      L,A
2489 8C       00554         ADC     A,H
248A 95       00555         SUB     L
248B 67       00556         LD      H,A
248C 23       00557         INC     HL
248D 7E       00558         LD      A,(HL)          ;P/u default DCT+4
248E E6F0     00559         AND     0F0H            ;Remove drive select
2490 B0       00560         OR      B               ;Merge in new one
2491 77       00561         LD      (HL),A          ;Update the DCT
2492 2B       00562         DEC     HL
2493 010700   00563         LD      BC,7            ;Init for 7-byte move
2496 D1       00564         POP     DE              ;DE => DCT$
2497 D5       00565         PUSH    DE              ;Save DCT$ pointer
2498 13       00566         INC     DE
2499 13       00567         INC     DE
249A 13       00568         INC     DE              ;Index to DCT+3
249B EDB0     00569         LDIR
249D D1       00570         POP     DE
249E D5       00571         PUSH    DE              ;Save start again
249F 3EC3     00572         LD      A,0C3H          ;Enabled drive
24A1 12       00573         LD      (DE),A
24A2 13       00574         INC     DE
24A3 210000   00575         LD      HL,$-$          ;Driver addr
24A4          00576 DVRADR  EQU     $-2
24A6 EB       00577         EX      DE,HL
24A7 73       00578         LD      (HL),E
24A8 23       00579         INC     HL
24A9 72       00580         LD      (HL),D
24AA D1       00581         POP     DE
              00582 ;
              00583 ;       Compute the actual drive number used
              00584 ;
24AB 0E00     00585         LD      C,0
24AD          00586         @@GTDCT                 ;Get drive 0
24AD+3E51     00587         LD      A,81
24AF+EF       00588         RST     40
24B0 FDE5     00589         PUSH    IY              ;Pass to HL for sub
24B2 E1       00590         POP     HL              ;HL => start DCT's
24B3 EB       00591         EX      DE,HL           ;DE=start, HL=current
24B4 B7       00592         OR      A               ;Clear carry
24B5 ED52     00593         SBC     HL,DE           ;HL = offset from start
24B7 0E0A     00594         LD      C,10            ;DCT length
24B9          00595         @@DIV16                 ;HL+A = HL/C
24B9+3E5E     00596         LD      A,94
24BB+EF       00597         RST     40
24BC 4D       00598         LD      C,L             ;Result = drive #
24BD          00599         @@RSTOR                 ;Restore drive
24BD+3E2C     00600         LD      A,44
24BF+EF       00601         RST     40
24C0 210000   00602         LD      HL,0            ;Set no error return
24C3 C9       00603         RET                     ;Init complete
              00604 ;
              00605 ;       Routines to read/write the config sector
              00606 ;
24C4 210027   00607 GETCFG  LD      HL,BUFFER       ;Use buffer for I/O
              00608 ;
              00609         IF      @MOD2
              00610         LD      C,L             ;Pass drive #
              00611         PUSH    IY              ;Save IY
              00612         @@GTDCT                 ;Fetch DCT
              00613         LD      A,(IY+3)        ;Get data
              00614         AND     28H             ;Bit 5/3
              00615         CP      20H             ;8" floppy?
              00616         JR      NZ,SETSYS1      ;Go if not
              00617         LD      A,(IY+4)        ;Fetch data
              00618         AND     50H             ;Bit 6/4
              00619         CP      40H             ;DD not alien?
              00620         JR      NZ,SETSYS1      ;Go if not
              00621         LD      D,(IY+9)        ;Get dir cyl
              00622         LD      E,L             ;Sector 0
              00623         @@RDSEC                 ;Read sector
              00624         CP      6               ;Directory?
              00625         JR      NZ,SETSYS2      ;Nope, error
              00626         LD      A,(BUFFER+0CDH) ;Get GAT data
              00627         BIT     7,A             ;System disk?
              00628 SETSYS1 LD      DE,0<8+2        ;Normal sysinfo sector
              00629         JR      NZ,$+3          ;Go if data disk
              00630         INC     D               ;  else sysinfo on 1
              00631         XOR     A               ;Set Z for no error
              00632 SETSYS2 POP     IY              ;Restore DCT
              00633         RET     NZ              ;Go if error
              00634         ENDIF
              00635 ;
              00636         IF      @MOD4
24C7 110200   00637         LD      DE,0<8+2        ;Get Config sector
              00638         ENDIF
24CA 4D       00639         LD      C,L             ;  of system drive
24CB          00640         @@RDSEC                 ;Read it into core
24CB+3E31     00641         LD      A,49
24CD+EF       00642         RST     40
24CE C9       00643         RET
              00644 ;
24CF 6F       00645 IOERR   LD      L,A             ;Error # to HL
24D0 2600     00646         LD      H,0
24D2 F6C0     00647         OR      0C0H            ;Abbrev, return
24D4 4F       00648         LD      C,A
24D5          00649         @@ERROR                 ;Display the error
24D5+3E1A     00650         LD      A,26
24D7+EF       00651         RST     40
24D8          00652         @@CKBRKC                ;Clear any Break
24D8+3E6A     00653         LD      A,106
24DA+EF       00654         RST     40
24DB C9       00655         RET
              00656 ;
              00657 ;       Internal error display routine
              00658 ;
24DC 218525   00659 VIASET  LD      HL,VIASET$      ;"Install with SYSTEM
24DF DD       00660         DB      0DDH
24E0 21A625   00661 ACTIVE  LD      HL,ACTIVE$      ;"Drive in use
24E3 DD       00662         DB      0DDH
24E4 210626   00663 BREAK   LD      HL,BREAK$       ;"Command aborted
24E7 DD       00664         DB      0DDH
24E8 21C425   00665 NODRV   LD      HL,NODRV$       ;"Need a drive #
24EB DD       00666         DB      0DDH
24EC 21E225   00667 NODVR   LD      HL,NODVR$       ;"Missing $FD...
24EF          00668         @@LOGOT
              00669         IFEQ    00H,1
              00670         LD      HL,
              00671         ENDIF
24EF+3E0C     00672         LD      A,12
24F1+EF       00673         RST     40
24F2 21FFFF   00674         LD      HL,-1           ;Set abort code
24F5          00675         @@CKBRKC                ;Clear any break
24F5+3E6A     00676         LD      A,106
24F7+EF       00677         RST     40
24F8 C9       00678         RET
              00679 ;
24F9 0A       00680 HELLO$  DB      LF,'FLOPPY Setup'
     46 4C 4F 50 50 59 20 53
     65 74 75 70 
2506          00681 *GET    CLIENT:3
              00682 ;CLIENT/ASM - File to establish sign-on headers
              00683 ; and version numbers.
              00684 ;
              00685 ; EACH STRING SHOULD CONTAIN ONLY 63 CHARACTERS !!
              00686 ;
              00687         IF      @BLD631
              00688 ;                12345678901234567890123456789012345678901234567890
2506 20       00689         DB      ' - 6.3.1 - Copyright 1982/83/84/86/90 by MISOSYS, ';<631>
     2D 20 36 2E 33 2E 31 20
     2D 20 43 6F 70 79 72 69
     67 68 74 20 31 39 38 32
     2F 38 33 2F 38 34 2F 38
     36 2F 39 30 20 62 79 20
     4D 49 53 4F 53 59 53 2C
     20 
2538 49       00690         DB      'Inc.,       ',10       ;<631>
     6E 63 2E 2C 20 20 20 20
     20 20 20 0A 
              00691         ELSE
              00692         DB      ' - 6.3.0 - Copyright 1982/83/84/86 by Logical Syst'
              00693         DB      'ems, Inc.   ',10
              00694         ENDIF
              00695 ;
              00696 ;       DB      'All Rights Reserved. Licensed 1982/83/84 to Tandy '
              00697 ;       DB      'Corporation.',10,13
              00698 ;
              00699 ;       DB      'All Rights Reserved. Beta-TEST Level/AD, DO NOT DI'
              00700 ;       DB      'STRIBUTE !! ',10,13
              00701 ;       DB      'All Rights reserved by LSI, 8970 N. 55th St. Milwa'
              00702 ;       DB      'ukee, Wisc. ',10,13
2545 41       00703         DB      'All Rights Reserved. Unauthorized duplication is p'
     6C 6C 20 52 69 67 68 74
     73 20 52 65 73 65 72 76
     65 64 2E 20 55 6E 61 75
     74 68 6F 72 69 7A 65 64
     20 64 75 70 6C 69 63 61
     74 69 6F 6E 20 69 73 20
     70 
2577 72       00704         DB      'rohibited.  ',10,13
     6F 68 69 62 69 74 65 64
     2E 20 20 0A 0D 
              00705 ;
2585 4D       00706 VIASET$ DB      'Must install via SYSTEM (DRIVER=',CR
     75 73 74 20 69 6E 73 74
     61 6C 6C 20 76 69 61 20
     53 59 53 54 45 4D 20 28
     44 52 49 56 45 52 3D 0D
25A6 44       00707 ACTIVE$ DB      'Drive slot is already enabled',CR
     72 69 76 65 20 73 6C 6F
     74 20 69 73 20 61 6C 72
     65 61 64 79 20 65 6E 61
     62 6C 65 64 0D 
25C4 4C       00708 NODRV$  DB      'Logical drive number required',CR
     6F 67 69 63 61 6C 20 64
     72 69 76 65 20 6E 75 6D
     62 65 72 20 72 65 71 75
     69 72 65 64 0D 
25E2 46       00709 NODVR$  DB      'Floppy driver not present in memory',CR
     6C 6F 70 70 79 20 64 72
     69 76 65 72 20 6E 6F 74
     20 70 72 65 73 65 6E 74
     20 69 6E 20 6D 65 6D 6F
     72 79 0D 
2606 43       00710 BREAK$  DB      'Command aborted',CR
     6F 6D 6D 61 6E 64 20 61
     62 6F 72 74 65 64 0D 
2616 24       00711 FDCNAM$ DB      '$FD',0
     46 44 00 
261A 20       00712 DRVTYP$ DB      '   Enter drive code (0=5", 1=8") > ',3
     20 20 45 6E 74 65 72 20
     64 72 69 76 65 20 63 6F
     64 65 20 28 30 3D 35 22
     2C 20 31 3D 38 22 29 20
     3E 20 03 
263E 20       00713 DRVADR$ DB      '   Enter drive I/O address <1-4> > ',3
     20 20 45 6E 74 65 72 20
     64 72 69 76 65 20 49 2F
     4F 20 61 64 64 72 65 73
     73 20 3C 31 2D 34 3E 20
     3E 20 03 
              00714 DRVTAB$
              00715 ;
              00716 ;       5" drive table
              00717 ;
2662 44       00718         DB      01000100B       ;5", 6ms, delay=n
2663 40       00719         DB      01000000B       ;DDEN
2664 FF       00720         DB      0FFH            ;Start cylinder
2665 27       00721         DB      40-1            ;40 track drive
2666 11       00722         DB      18-1            ;18 sec per cyl
2667 45       00723         DB      3-1<5+6-1       ;6 sec/gran, 3 gran/cyl
2668 14       00724         DB      40/2            ;Directory track
              00725 ;
              00726 ;       8" table
              00727 ;
              00728         IF      @MOD4
2669 21       00729         DB      00100001B       ;8", 6ms step
266A 40       00730         DB      01000000B       ;DDEN
266B FF       00731         DB      0FFH            ;Start cylinder
266C 4C       00732         DB      77-1            ;77 track drive
266D 0F       00733         DB      16-1            ;16 sec per cyl
266E 27       00734         DB      2-1<5+8-1       ;8 sec/gran, 2 gran/cyl
266F 26       00735         DB      77/2            ;Directory track
              00736         ENDIF
              00737 ;
              00738         IF      @MOD2
              00739         DB      01100010B       ;+3 - 8", DD, 10ms, delay
              00740         DB      01000000B       ;+4 - DDen capable
              00741         DB      4CH             ;+5 - current cyl
              00742         DB      77-1            ;+6 - high cylinder
              00743         DB      0<5+29          ;+7 - sides + high sec
              00744         DB      2<5+9           ;+8 - grans/cyl + sec/grn
              00745         DB      77/2            ;+9 - dir cylinder
              00746         ENDIF
              00747 ;
2670          00748 BUF     DS      2
2700          00749         ORG     $<-8+1<+8
2700          00750 BUFFER  DS      256
              00751 ;
2400          00752         END     BEGIN
2400 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]

Valid HTML 4.01!