[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 at nemesis.lonestar.org]
MISOSYS EDAS-4.3 04/11/99 00:20:05 LIB - LS-DOS 6.2 Page 00001
00001 ;LBLIB/ASM - LIB/CLS/TOF Commands
0000 00003 *GET BUILDVER:3
00004 ;
00005 ; Buildver/asm is a bit of a kludge since not all utilities can load
00006 ; equates from LDOS60 and still compile. LOWCORE and everybody else
00007 ; relies on this setting, and it eventually ends up in LDOS60/EQU
00008 ; for programs that can use that.
00009 ;
FFFF 00010 @BLD631 EQU -1 ;<631>Build 631 distribution (LEVEL 1B)
00011 ; These switches activate patches made since the 1B release.
00012 ; It is important that all earlier patches be enabled when a higher
00013 ; patch is enabled.
00014 ; Patches C thru F were published in TMQ IV.iv, page 32 (NOTE: the
00015 ; patch addresses listed for SPOOL in SPOOL1/FIX are 19H high.)
FFFF 00016 @BLD631C EQU -1 ;<631>Apply 1C patches (SETKI)
FFFF 00017 @BLD631D EQU -1 ;<631>Apply 1D patches (DIR)
FFFF 00018 @BLD631E EQU -1 ;<631>Apply 1E patches (DIR & MEMDISK/DCT)
FFFF 00019 @BLD631F EQU -1 ;<631>Apply 1F patches (SPOOL)
00020 ; Patches G and H were published in TMQ V.i, pages 10 and 18/19.
FFFF 00021 @BLD631G EQU -1 ;<631>Apply 1G patches (//KEYIN,DIR,DO *)
FFFF 00022 @BLD631H EQU -1 ;<631>Apply 1H patches (MEMORY)
00023 ;
00024 ;End of BUILDVER/ASM
0000 00025 *GET SVCMAC:3 ;SVC Macro equivalents
00026 ;SVCMAC/ASM - LS-DOS Version VI
00027 *LIST OFF
00419 *LIST ON
00421 ;
000D 00422 CR EQU 13
000A 00423 LF EQU 10
1E00 00424 OVLAY$ EQU 1E00H
101F 00425 IDBYT EQU 101FH ;Ptr to serial #
00426 ;
2400 00427 ORG 2400H
00428 ;
00429 ;
00430 ; LIB command entry point
00431 ;
2400 C32224 00432 LIB JP JPLIB ;Skip around to 'LIB'
00433 ;
00434 ; CLS command entry point
00435 ;
2403 C31C24 00436 JP CLS ;Skip around to 'CLS'
2406 C30025 00437 JP DOID ;ID entry pt
00438 ;
00439 ; TOF command entry point
00440 ;
00441 TOF
2409 0E0C 00442 LD C,12 ;Load TOF character
240B 00443 @@PRT ;Do @PRT SVC
240B+3E06 00444 LD A,6
240D+EF 00445 RST 40
00446 IF @BLD631
00447 L240E:
00448 ENDIF
240E 210000 00449 LD HL,0 ;Init to no error
2411 C8 00450 RET Z ; and back if ok
2412 6F 00451 TOFERR LD L,A ;Error code to HL
2413 2600 00452 LD H,0
2415 F6C0 00453 OR 0C0H ;Abbrev, return
2417 4F 00454 LD C,A
2418 00455 @@ERROR
2418+3E1A 00456 LD A,26
241A+EF 00457 RST 40
241B C9 00458 RET
00459 ;
241C 3E69 00460 CLS LD A,105 ;@CLS svc
241E EF 00461 RST 40 ; and do it
241F AF 00462 XOR A ;Ret without error
00463 IF @BLD631
2420 18EC 00464 JR L240E ;<631>
00465 ELSE
00466 LD L,A
00467 LD H,A
00468 RET
00469 ENDIF
00470 ;
2422 0603 00471 JPLIB LD B,3 ;Init for 3 libraries
2424 C5 00472 LIB0 PUSH BC
2425 00473 @@DSPLY LIBMSG
00474 IFEQ 01H,1
2425+219224 00475 LD HL,LIBMSG
00476 ENDIF
2428+3E0A 00477 LD A,10
242A+EF 00478 RST 40
242B 360A 00479 LD (HL),LF ;Put LF at start of
00480 ; string for next time
242D 2A021E 00481 LD HL,(OVLAY$+2) ;PU table pointer
2430 0602 00482 LIB1 LD B,2 ;Dsply 1st command
2432 CD8A24 00483 CALL TAB ; tabbed in 2 spaces
2435 0E07 00484 LD C,7 ;Init for 7-across
2437 7E 00485 LIB2 LD A,(HL)
2438 B7 00486 OR A
2439 2837 00487 JR Z,LIB4 ;Jump on end
243B E5 00488 PUSH HL
243C 110700 00489 LD DE,7 ;Index to lib #
243F 19 00490 ADD HL,DE
2440 3E80 00491 LIBX LD A,80H ;Init for LIB-A
2442 BE 00492 CP (HL) ;Is this command in
2443 2804 00493 JR Z,LIB2A ; the current library?
2445 F1 00494 POP AF ;Is not, skip past it
2446 23 00495 INC HL
2447 18EE 00496 JR LIB2
00497 ;
2449 E1 00498 LIB2A POP HL ;Get 1st char of command
244A C5 00499 PUSH BC ;Save reg C
244B 4E 00500 LD C,(HL) ; and display in upper
244C 00501 @@DSP
244C+3E02 00502 LD A,2
244E+EF 00503 RST 40
244F 0605 00504 LD B,5 ;Write 6-char LIB word
2451 23 00505 LIB3 INC HL ;Point to next char
2452 7E 00506 LD A,(HL)
2453 FE20 00507 CP ' ' ;If space, don't lower
2455 2802 00508 JR Z,$+4 ; case the char
2457 EE20 00509 XOR 20H
2459 4F 00510 LD C,A ;Xfer to C & display it
245A 00511 @@DSP
245A+3E02 00512 LD A,2
245C+EF 00513 RST 40
245D 10F2 00514 DJNZ LIB3
00515 ;
245F 0605 00516 LD B,5 ;Move over 5 spaces
2461 CD8A24 00517 CALL TAB ; for start of next command
2464 23 00518 INC HL ;Bypass LIB parm vector
2465 23 00519 INC HL
2466 23 00520 INC HL
2467 C1 00521 POP BC ;Get across counter
2468 0D 00522 DEC C ; & decrement
2469 20CC 00523 JR NZ,LIB2 ;Loop on < 7
246B 0E0D 00524 LD C,CR ;Write a new line
246D 00525 @@DSP
246D+3E02 00526 LD A,2
246F+EF 00527 RST 40
2470 18BE 00528 JR LIB1 ;Loop
00529 ;
2472 0E0D 00530 LIB4 LD C,CR ;End with new line
2474 00531 @@DSP
2474+3E02 00532 LD A,2
2476+EF 00533 RST 40
2477 219C24 00534 LD HL,LIBMSG+10
247A 34 00535 INC (HL) ;Bump to next lib
247B 3A4124 00536 LD A,(LIBX+1) ;Advance RST code also
247E C620 00537 ADD A,20H
2480 324124 00538 LD (LIBX+1),A
2483 C1 00539 POP BC ;Recover Lib count
2484 109E 00540 DJNZ LIB0 ;Loop until all done
2486 210000 00541 LD HL,0 ;Set no error
2489 C9 00542 RET
00543 ;
248A 0E20 00544 TAB LD C,' ' ;Display spaces,
248C 00545 @@DSP
248C+3E02 00546 LD A,2
248E+EF 00547 RST 40
248F 10F9 00548 DJNZ TAB ; reg B has count
2491 C9 00549 RET
00550 ;
2492 00 00551 LIBMSG DB 0,'Library ',CR
4C 69 62 72 61 72 79 20
3C 41 3E 0D
00552 ;
00553 ; Generate ID code
00554 ;
00555 IFLT $,2500H
2500 00556 ORG 2500H
00557 ENDIF
00558 ;
00559 IF @BLD631
2500 210A25 00560 DOID LD HL,NOID$ ;<631>
2503 00561 @@DSPLY ;<631>
00562 IFEQ 00H,1
00563 LD HL,
00564 ENDIF
2503+3E0A 00565 LD A,10
2505+EF 00566 RST 40
2506 210000 00567 LD HL,0 ;<631>
2509 C9 00568 RET ;<631>
250A 4E 00569 NOID$ DB 'No service contract!',CR ;<631>
6F 20 73 65 72 76 69 63
65 20 63 6F 6E 74 72 61
63 74 21 0D
00570 ELSE
00571 NOID LD HL,NOID$
00572 DB 0DDH
00573 BADID LD HL,BADID$
00574 @@LOGOT
00575 LD HL,-1
00576 JR EXIT1
00577 EXIT LD HL,0
00578 EXIT1 LD SP,$-$
00579 SAVSTK EQU $-2
00580 @@CKBRKC
00581 RET
00582 ;
00583 NOID$ DB 'Error reading ID file',CR
00584 BADID$ DB 'Invalid customer service ID found',CR
00585 ;
00586 DOID
00587 LD (SAVSTK),SP
00588 LD HL,FCB0 ;Make usable name
00589 PUSH HL
00590 LD B,15
00591 IDLP1 LD A,(HL)
00592 XOR 1BH
00593 LD (HL),A
00594 INC HL
00595 DJNZ IDLP1
00596 POP DE
00597 LD HL,1400H
00598 LD B,0
00599 @@FLAGS ;Get the flag table
00600 SET 0,(IY+'S'-'A') ;No open bit
00601 LD A,24H
00602 ADD A,B
00603 LD H,A
00604 @@OPEN
00605 JP NZ,NOID
00606 LD C,IDBYT<-8
00607 @@POSN ;Get the sector
00608 @@READ
00609 JP NZ,NOID ;Quit on error
00610 LD L,IDBYT&0FFH ;This should be '#'
00611 LD A,(HL)
00612 CP '#'
00613 JP NZ,BADID ;Bad if not
00614 LD A,L ;Now add offset to
00615 ADD A,12
00616 LD E,A
00617 LD D,H
00618 PUSH DE
00619 LD HL,IDRET ;Continue pt
00620 EX (SP),HL
00621 PUSH HL ;Push junk
00622 CALL IDBYT&0FFH+12+2400H
00623 IDRET AND 98H ;See if we came back
00624 XOR 80H
00625 CP 18H
00626 JP NZ,BADID
00627 POP HL ;Get back buffer ptr
00628 POP DE ;Pop address junk
00629 LD B,10 ;Count of digits
00630 LD E,D ;25h
00631 LD D,22H ;Pt to sysbuf
00632 LD A,E
00633 DEC L
00634 XOR 11011010B
00635 LD E,A ;Must be 22ffh
00636 IDLP2 LD A,(HL)
00637 DEC L
00638 SUB 30H
00639 LD (DE),A
00640 DEC DE
00641 DJNZ IDLP2
00642 ;
00643 CALL DOSYS3
00644 JP EXIT
00645 ;
00646 DOSYS3 LD A,80H!30H!5 ;SYS3,entry 30h
00647 RST 40 ;Execute overlay
00648 ;
00649 FCB0 DB 'HBH+4HBH5WHR_TH',3
00650 DS 20 ;FCB FOR SYS0
00651 ENDIF
2400 00652 END LIB
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 at nemesis.lonestar.org]