[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]
00001 ;LBAUTO/ASM - AUTO Command
00003 ;
00004 ;
0000 00005 *GET BUILDVER/ASM:3
00006 ;
00007 ; Buildver/asm is a bit of a kludge since not all utilities can load
00008 ; equates from LDOS60 and still compile. LOWCORE and everybody else
00009 ; relies on this setting, and it eventually ends up in LDOS60/EQU
00010 ; for programs that can use that.
00011 ;
FFFF 00012 @BLD631 EQU -1 ;<631>Build 631 distribution (LEVEL 1B)
00013 ; These switches activate patches made since the 1B release.
00014 ; It is important that all earlier patches be enabled when a higher
00015 ; patch is enabled.
00016 ; Patches C thru F were published in TMQ IV.iv, page 32 (NOTE: the
00017 ; patch addresses listed for SPOOL in SPOOL1/FIX are 19H high.)
FFFF 00018 @BLD631C EQU -1 ;<631>Apply 1C patches (SETKI)
FFFF 00019 @BLD631D EQU -1 ;<631>Apply 1D patches (DIR)
FFFF 00020 @BLD631E EQU -1 ;<631>Apply 1E patches (DIR & MEMDISK/DCT)
FFFF 00021 @BLD631F EQU -1 ;<631>Apply 1F patches (SPOOL)
00022 ; Patches G and H were published in TMQ V.i, pages 10 and 18/19.
FFFF 00023 @BLD631G EQU -1 ;<631>Apply 1G patches (//KEYIN,DIR,DO *)
FFFF 00024 @BLD631H EQU -1 ;<631>Apply 1H patches (MEMORY)
00025 ;
00026 ;End of BUILDVER/ASM
0000 00027 *GET SVCMAC:3 ;SVC Macro equivalents
00028 ;SVCMAC/ASM - LS-DOS Version VI
00029 *LIST OFF
00421 *LIST ON
0000 00423 *GET VALUES:3 ;Misc. equates
00424 ;VALUES/ASM - Version 6
00425 *LIST OFF
00452 *LIST ON
00453 ;
0002 00454 SECTOR EQU 0<8+2
0020 00455 OFFSET EQU 20H ;Offset to Auto Buffer
0028 00456 RST28 EQU 28H ;SVC restart
0019 00457 @CMNDR EQU 25 ;Execute & return
0031 00458 @RDSEC EQU 49 ;Read a sector SVC #
0035 00459 @WRSEC EQU 53 ;Write a sector SVC #
00460 ;
2400 00461 ORG 2400H
00462 ;
00463 AUTO
2400 ED730B24 00464 LD (SAVESP+1),SP ;Save SP address
2404 CD0E24 00465 CALL PARSE ;Do AUTO command
2407 210000 00466 LD HL,0 ;Set no error
00467 ;
00468 ; Reinstall SP & RETurn
00469 ;
240A 310000 00470 SAVESP LD SP,$-$ ;P/u old SP
240D C9 00471 RET
00472 ;
00473 ; Skip any leading spaces
00474 ;
240E 2B 00475 PARSE DEC HL ;Back one
240F 23 00476 PARSE2 INC HL ;Bump buff ptr
2410 7E 00477 LD A,(HL) ;P/u character
2411 FE20 00478 CP ' ' ;Space ?
2413 28FA 00479 JR Z,PARSE2 ;Go til non-space
00480 ;
00481 ; Display auto Buffer on drive :d ?
00482 ;
2415 FE3F 00483 CP '?' ;Display auto buffer ?
2417 2809 00484 JR Z,DISAUTO
00485 ;
00486 ; Execute Auto Buffer on drive :d ?
00487 ;
2419 FE3D 00488 CP '=' ;Execute auto buffer ?
241B 280F 00489 JR Z,EXAUTO
00490 ;
00491 ; Install the command in the auto buffer
00492 ;
241D CD5124 00493 CALL GETDRV ;P/u drive #
2420 184B 00494 JR WRBUFF ;Write new auto & RETurn
00495 ;
00496 ; Display command in auto buffer
00497 ;
2422 CD4724 00498 DISAUTO CALL GETAUTO ;P/u drive #
2425 00499 @@LOGOT ;Display it
00500 IFEQ 00H,1
00501 LD HL,
00502 ENDIF
2425+3E0C 00503 LD A,12
2427+EF 00504 RST 40
2428 C29E24 00505 JP NZ,IOERR ;NZ - I/O Error
242B C9 00506 RET ;Z - done
00507 ;
00508 ; Execute command in auto buffer
00509 ;
242C CD4724 00510 EXAUTO CALL GETAUTO ;P/u drive #
242F 00511 @@FLAGS
242F+3E65 00512 LD A,101
2431+EF 00513 RST 40
2432 7E 00514 LD A,(HL) ;P/u first character
2433 FE2A 00515 CP '*' ;Non-able auto ?
2435 2005 00516 JR NZ,DOAUTO ;No - do it
00517 ;
00518 ; Non able auto command - skip "*"
00519 ;
2437 23 00520 INC HL ;Bump to next char
2438 FDCB12E6 00521 SET 4,(IY+SFLAG$) ;Disable
00522 ;
00523 ; Exit via @CMNDI or @CMNDR if requested
00524 ;
243C FDCB024E 00525 DOAUTO BIT 1,(IY+CFLAG$) ;If CMNDR executing, then
2440 3E19 00526 LD A,@CMNDR ; exit via CMNDR
2442 C22800 00527 JP NZ,RST28
2445 3D 00528 DEC A ; else readjust to
2446 EF 00529 RST 40 ; CMNDI & exit
00530 ;
00531 ; GETAUTO - Get Auto Command from BOOT sector
00532 ;
00533 ; Advance to next byte in line
00534 ;
2447 23 00535 GETAUTO INC HL ;Bump to next char
2448 7E 00536 LD A,(HL) ; & p/u 1st char of drvspc
2449 CD5124 00537 CALL GETDRV ;Get drive #
244C CD8224 00538 CALL RDBOOT ;Read BOOT sector
244F EB 00539 EX DE,HL ;Pt HL to auto buffer
2450 C9 00540 RET ;RETurn
00541 ;
00542 ; GETDRV - Check if (HL) contains a legal drive #
00543 ;
2451 FE0E 00544 GETDRV CP CR+1 ;No drivespec ?
2453 D8 00545 RET C ;Use drive 0 as default
00546 ;
00547 ; Drivespec indicator entered ?
00548 ;
2454 FE3A 00549 CP ':' ;Drivespec indicator ?
2456 C0 00550 RET NZ ;No - use drive 0
00551 ;
00552 ; Drivespec ":" entered - p/u drive #
00553 ;
2457 23 00554 INC HL ;Position to drive #
2458 46 00555 LD B,(HL) ;P/u drive #
00556 ;
00557 ; Position to command following drivspec
00558 ;
2459 23 00559 INC HL ;Position to command
245A 7E 00560 LD A,(HL) ;C/R following spec ?
245B FE0E 00561 CP CR+1
245D 3801 00562 JR C,SKIPINC ;Yes - don't INC
245F 23 00563 INC HL ;Position to command
00564 ;
00565 ; Is the drive number in legal range ?
00566 ;
2460 78 00567 SKIPINC LD A,B ;P/u Drive #
2461 D630 00568 SUB '0' ;Less than "0" ?
2463 329424 00569 LD (DRIVE+1),A ;Stuff away drive #
00570 IF @BLD631
00571 ELSE
00572 JR C,ILDRIVE ;C - Illegal drive #
00573 ENDIF
2466 FE08 00574 CP 7+1 ;Greater than 7 ?
2468 D8 00575 RET C ;RETurn if legal
00576 ;
00577 ; Illegal Drive Number - Display & abort
00578 ;
2469 3E20 00579 ILDRIVE LD A,32 ;Init "Illegal drive #
246B 1831 00580 JR IOERR ;Abort
00581 ;
00582 ; WRBUFF - Write Auto Command to Boot
00583 ;
246D CD8224 00584 WRBUFF CALL RDBOOT ;Read in BOOT
00585 ;
00586 ; Skip Leading spaces
00587 ;
2470 2B 00588 DEC HL ;Skip leading spaces
2471 23 00589 SKPSPCS INC HL
2472 7E 00590 LD A,(HL) ;P/u char
2473 FE20 00591 CP ' ' ;Space ?
2475 28FA 00592 JR Z,SKPSPCS ;Yes - skip it
00593 ;
00594 ; Transfer command into buffer
00595 ;
2477 7E 00596 XFLP LD A,(HL) ;P/u byte
2478 EDA0 00597 LDI ;(HL) => (DE) INC HL & DE
247A FE0E 00598 CP CR+1 ;Eol ?
247C 30F9 00599 JR NC,XFLP
00600 ;
00601 ; RDBOOT/WRBOOT - Read/Write BOOT sector
00602 ;
00603 ; Set A = @WRSEC Supervisory CALL #
00604 ;
247E 3E35 00605 WRBOOT LD A,@WRSEC ;Write Sector SVC #
2480 180D 00606 JR BOOTIO ;Go to I/O routine
00607 ;
00608 ; RDBOOT - Check if the Drive is there
00609 ;
2482 3A9424 00610 RDBOOT LD A,(DRIVE+1) ;P/u drive #
2485 4F 00611 LD C,A ;Xfer to C for @CKDRV
2486 00612 @@CKDRV ;Drive alive
2486+3E21 00613 LD A,33
2488+EF 00614 RST 40
2489 3E20 00615 LD A,32 ;Init "Illegal drive #
248B 2011 00616 JR NZ,IOERR ;Abort if bad drive
00617 ;
00618 ; Read GAT from directory if Model II
00619 ;
00620 IF @MOD2
00621 PUSH IY ;Save
00622 @@GTDCT ;Locate DCT
00623 LD D,(IY+9) ;Dir cyl
00624 LD A,(IY+3) ;Get DCT data
00625 LD E,(IY+4) ;Get dct data
00626 POP IY ;Restore
00627 AND 28H ;8" floppy?
00628 CP 20H ;Yes?
00629 JR NZ,SETSYSI ;Nope, sysinfo on 0
00630 LD A,E ;Get +4
00631 AND 50H ;Bit 6/4
00632 CP 40H ;DD not alien?
00633 JR NZ,SETSYSI ;Go if alien
00634 ;
00635 PUSH HL ;Save
00636 LD HL,BUFF ;Start buffer
00637 LD E,0 ;GAT table
00638 @@RDSSC ;Read directory
00639 LD DE,(BUFF+0CDH) ;Get GAT info byte
00640 POP HL ;Restore buffer
00641 JR NZ,IOERR ;Go on disk error
00642 BIT 7,E ;System disk?
00643 SETSYSI LD DE,SECTOR ;Sysinfo sector
00644 JR NZ,$+3 ;Go if data disk
00645 INC D ;Sysinfo on cyl 1
00646 LD (SYSINFO),DE ;Save sysinfo sector
00647 ENDIF
248D 3E31 00648 LD A,@RDSEC ;A = @RDSEC SVC #
00649 ;
00650 ; Pt HL => Buffer, DE = T/S, C = :d, A = SVC #
00651 ;
248F E5 00652 BOOTIO PUSH HL ;Save command ptr
2490 210025 00653 LD HL,BUFF ;HL => I/O buffer
2493 0E00 00654 DRIVE LD C,$-$ ;P/u drive # in C
00655 ;
2495 110200 00656 LD DE,SECTOR ;DE = Track 0, Sector 2
2496 00657 SYSINFO EQU $-2
00658 ;
00659 ; Issue SVC & point DE => Auto comm buffer
00660 ;
2498 EF 00661 RST 40 ;Read or Write Sector
2499 E1 00662 POP HL ;Recover command ptr
249A 112025 00663 LD DE,BUFF+OFFSET ;DE => Auto command buff
249D C8 00664 RET Z ;RETurn if successful
00665 ;
00666 ; I/O Error Handler - Clean up stack & Abort
00667 ;
249E 6F 00668 IOERR LD L,A ;Set HL = Error #
249F 2600 00669 LD H,0
24A1 F6C0 00670 OR 0C0H ;Short error message
24A3 4F 00671 LD C,A ;Xfer to C for @ERROR
24A4 00672 @@ERROR ;Display error
24A4+3E1A 00673 LD A,26
24A6+EF 00674 RST 40
24A7 C30A24 00675 JP SAVESP ;Exit
00676 ;
2500 00677 BUFF EQU $<-8+1<+8 ;Next page boundary
00678 ;
2400 00679 END AUTO
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]