[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 01:02:14 LINK - LS-DOS 6.2 Page 00001
00001 ;LBLINK/ASM - LINK Command
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 ;
2400 00402 ORG 2400H
00403 ;
2400 11AA24 00404 LINK LD DE,FCB1 ;Fetch source spec
2403 00405 @@FSPEC
2403+3E4E 00406 LD A,78
2405+EF 00407 RST 40
2406 2010 00408 JR NZ,SPCERR1 ;Exit if bad name
2408 1A 00409 LD A,(DE) ;Must be a device
2409 FE2A 00410 CP '*'
240B 207E 00411 JR NZ,SPCERR
00412 ;
00413 ; Fetch the second device spec
00414 ;
240D 11AD24 00415 LD DE,FCB2 ;Fetch destination spec
2410 00416 @@FSPEC
2410+3E4E 00417 LD A,78
2412+EF 00418 RST 40
2413 2076 00419 JR NZ,SPCERR ;Exit if bad name
2415 1A 00420 LD A,(DE)
2416 FE2A 00421 CP '*' ;Must also be a device
2418 2071 00422 SPCERR1 JR NZ,SPCERR
00423 ;
00424 ; Make sure source <> destination
00425 ;
241A 2AAB24 00426 LD HL,(FCB1+1) ;If devices are the same,
241D ED5BAE24 00427 LD DE,(FCB2+1) ; then quit
2421 ED52 00428 SBC HL,DE
2423 2866 00429 JR Z,SPCERR
00430 ;
00431 ; Locate a spare DCB for the link
00432 ;
2425 110000 00433 LD DE,0
2428 00434 @@GTDCB
2428+3E52 00435 LD A,82
242A+EF 00436 RST 40
242B 3E21 00437 LD A,33 ;Init "No device space...
242D 2052 00438 JR NZ,IOERR
242F 224A24 00439 LD (LINKDCB+1),HL ;Save pointer
00440 ;
00441 ; Locate destination DCB address
00442 ;
2432 ED5BAE24 00443 LD DE,(FCB2+1) ;Grab DCB name
2436 00444 @@GTDCB ;Locate its address
2436+3E52 00445 LD A,82
2438+EF 00446 RST 40
2439 2046 00447 JR NZ,IOERR ;Jump if not found
243B 226824 00448 LD (DSTDCB+1),HL ;Save destination
00449 ;
00450 ; Locate source DCB address
00451 ;
243E ED5BAB24 00452 LD DE,(FCB1+1) ;Get 1st DCB name
2442 00453 @@GTDCB ;Locate in device tables
2442+3E52 00454 LD A,82
2444+EF 00455 RST 40
2445 203A 00456 JR NZ,IOERR ;Jump if not found
2447 E5 00457 PUSH HL ;Save pointer we used
2448 F3 00458 DI ;Can't interrupt
00459 ;
00460 ; Save the old device vector while stuffing new
00461 ;
2449 010000 00462 LINKDCB LD BC,$-$ ;P/u link DCB address
244C 2C 00463 INC L ;Bump to vector
244D 7E 00464 LD A,(HL) ;Save what's there
244E 71 00465 LD (HL),C ;Stuff link address
244F 4F 00466 LD C,A ; into DCB of source
2450 2C 00467 INC L ; while saving old
2451 7E 00468 LD A,(HL) ; vector for storage
2452 70 00469 LD (HL),B ; (could be a FCB)
2453 47 00470 LD B,A
00471 ;
00472 ; Now set LINK bit and rest of LINK DCB block
00473 ;
2454 E1 00474 POP HL ;Rcvr ptr to source DCB+0
2455 7E 00475 LD A,(HL) ;Init the LINK bit
2456 F5 00476 PUSH AF ;Save old TYPE byte
2457 E607 00477 AND 7 ;Strip flags
2459 F620 00478 OR 20H ;Set Link bit
245B 77 00479 LD (HL),A ;Show source is linked
245C 2A4A24 00480 LD HL,(LINKDCB+1) ;P/u link DCB address
245F F1 00481 POP AF ;Rcvr source TYPE
2460 77 00482 LD (HL),A ;New LINK TYPE
2461 2C 00483 INC L
2462 71 00484 LD (HL),C ;Stuff source vector
2463 2C 00485 INC L
2464 70 00486 LD (HL),B
2465 2C 00487 INC L ;Bypass dest TYPE
2466 2C 00488 INC L
2467 010000 00489 DSTDCB LD BC,$-$ ;P/u destination DCB addr
246A 71 00490 LD (HL),C ; & stuff into link DCB
246B 2C 00491 INC L
246C 70 00492 LD (HL),B
246D 2C 00493 INC L
246E E5 00494 PUSH HL ;Save name field pointer
246F 114C2F 00495 LD DE,'/L' ;Let's find a link name
2472 14 00496 NAMLP INC D ;Bump "2nd" character
2473 00497 @@GTDCB ;If we find this name
2473+3E52 00498 LD A,82
2475+EF 00499 RST 40
2476 28FA 00500 JR Z,NAMLP ; look for another
2478 E1 00501 POP HL ;Get name pointer
2479 73 00502 LD (HL),E ; & stuff in the
247A 2C 00503 INC L ; selected link name
247B 72 00504 LD (HL),D
247C FB 00505 EI ;Start tasks again
247D 210000 00506 LD HL,0 ;Show no error
2480 C9 00507 RET
00508 ;
00509 ; Error processing
00510 ;
2481 6F 00511 IOERR LD L,A ;Move error # into HL
2482 2600 00512 LD H,0
2484 F6C0 00513 OR 0C0H ;Abbrev & return
2486 4F 00514 LD C,A
2487 00515 @@ERROR
2487+3E1A 00516 LD A,26
2489+EF 00517 RST 40
248A C9 00518 RET
248B 219524 00519 SPCERR LD HL,SPCERR$ ;Bad devspec found
248E 00520 @@LOGOT
00521 IFEQ 00H,1
00522 LD HL,
00523 ENDIF
248E+3E0C 00524 LD A,12
2490+EF 00525 RST 40
2491 21FFFF 00526 LD HL,-1
2494 C9 00527 RET
2495 44 00528 SPCERR$ 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
24AA 00529 FCB1 DS 3 ;Only 3-bytes needed
24AD 00530 FCB2 DS 32
2400 00531 END LINK
2400 is the transfer address
00000 Total errors
00001 ;LBLINK/ASM - LINK Command
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 ;
2400 00402 ORG 2400H
00403 ;
2400 11AA24 00404 LINK LD DE,FCB1 ;Fetch source spec
2403 00405 @@FSPEC
2403+3E4E 00406 LD A,78
2405+EF 00407 RST 40
2406 2010 00408 JR NZ,SPCERR1 ;Exit if bad name
2408 1A 00409 LD A,(DE) ;Must be a device
2409 FE2A 00410 CP '*'
240B 207E 00411 JR NZ,SPCERR
00412 ;
00413 ; Fetch the second device spec
00414 ;
240D 11AD24 00415 LD DE,FCB2 ;Fetch destination spec
2410 00416 @@FSPEC
2410+3E4E 00417 LD A,78
2412+EF 00418 RST 40
2413 2076 00419 JR NZ,SPCERR ;Exit if bad name
2415 1A 00420 LD A,(DE)
2416 FE2A 00421 CP '*' ;Must also be a device
2418 2071 00422 SPCERR1 JR NZ,SPCERR
00423 ;
00424 ; Make sure source <> destination
00425 ;
241A 2AAB24 00426 LD HL,(FCB1+1) ;If devices are the same,
241D ED5BAE24 00427 LD DE,(FCB2+1) ; then quit
2421 ED52 00428 SBC HL,DE
2423 2866 00429 JR Z,SPCERR
00430 ;
00431 ; Locate a spare DCB for the link
00432 ;
2425 110000 00433 LD DE,0
2428 00434 @@GTDCB
2428+3E52 00435 LD A,82
242A+EF 00436 RST 40
242B 3E21 00437 LD A,33 ;Init "No device space...
242D 2052 00438 JR NZ,IOERR
242F 224A24 00439 LD (LINKDCB+1),HL ;Save pointer
00440 ;
00441 ; Locate destination DCB address
00442 ;
2432 ED5BAE24 00443 LD DE,(FCB2+1) ;Grab DCB name
2436 00444 @@GTDCB ;Locate its address
2436+3E52 00445 LD A,82
2438+EF 00446 RST 40
2439 2046 00447 JR NZ,IOERR ;Jump if not found
243B 226824 00448 LD (DSTDCB+1),HL ;Save destination
00449 ;
00450 ; Locate source DCB address
00451 ;
243E ED5BAB24 00452 LD DE,(FCB1+1) ;Get 1st DCB name
2442 00453 @@GTDCB ;Locate in device tables
2442+3E52 00454 LD A,82
2444+EF 00455 RST 40
2445 203A 00456 JR NZ,IOERR ;Jump if not found
2447 E5 00457 PUSH HL ;Save pointer we used
2448 F3 00458 DI ;Can't interrupt
00459 ;
00460 ; Save the old device vector while stuffing new
00461 ;
2449 010000 00462 LINKDCB LD BC,$-$ ;P/u link DCB address
244C 2C 00463 INC L ;Bump to vector
244D 7E 00464 LD A,(HL) ;Save what's there
244E 71 00465 LD (HL),C ;Stuff link address
244F 4F 00466 LD C,A ; into DCB of source
2450 2C 00467 INC L ; while saving old
2451 7E 00468 LD A,(HL) ; vector for storage
2452 70 00469 LD (HL),B ; (could be a FCB)
2453 47 00470 LD B,A
00471 ;
00472 ; Now set LINK bit and rest of LINK DCB block
00473 ;
2454 E1 00474 POP HL ;Rcvr ptr to source DCB+0
2455 7E 00475 LD A,(HL) ;Init the LINK bit
2456 F5 00476 PUSH AF ;Save old TYPE byte
2457 E607 00477 AND 7 ;Strip flags
2459 F620 00478 OR 20H ;Set Link bit
245B 77 00479 LD (HL),A ;Show source is linked
245C 2A4A24 00480 LD HL,(LINKDCB+1) ;P/u link DCB address
245F F1 00481 POP AF ;Rcvr source TYPE
2460 77 00482 LD (HL),A ;New LINK TYPE
2461 2C 00483 INC L
2462 71 00484 LD (HL),C ;Stuff source vector
2463 2C 00485 INC L
2464 70 00486 LD (HL),B
2465 2C 00487 INC L ;Bypass dest TYPE
2466 2C 00488 INC L
2467 010000 00489 DSTDCB LD BC,$-$ ;P/u destination DCB addr
246A 71 00490 LD (HL),C ; & stuff into link DCB
246B 2C 00491 INC L
246C 70 00492 LD (HL),B
246D 2C 00493 INC L
246E E5 00494 PUSH HL ;Save name field pointer
246F 114C2F 00495 LD DE,'/L' ;Let's find a link name
2472 14 00496 NAMLP INC D ;Bump "2nd" character
2473 00497 @@GTDCB ;If we find this name
2473+3E52 00498 LD A,82
2475+EF 00499 RST 40
2476 28FA 00500 JR Z,NAMLP ; look for another
2478 E1 00501 POP HL ;Get name pointer
2479 73 00502 LD (HL),E ; & stuff in the
247A 2C 00503 INC L ; selected link name
247B 72 00504 LD (HL),D
247C FB 00505 EI ;Start tasks again
247D 210000 00506 LD HL,0 ;Show no error
2480 C9 00507 RET
00508 ;
00509 ; Error processing
00510 ;
2481 6F 00511 IOERR LD L,A ;Move error # into HL
2482 2600 00512 LD H,0
2484 F6C0 00513 OR 0C0H ;Abbrev & return
2486 4F 00514 LD C,A
2487 00515 @@ERROR
2487+3E1A 00516 LD A,26
2489+EF 00517 RST 40
248A C9 00518 RET
248B 219524 00519 SPCERR LD HL,SPCERR$ ;Bad devspec found
248E 00520 @@LOGOT
00521 IFEQ 00H,1
00522 LD HL,
00523 ENDIF
248E+3E0C 00524 LD A,12
2490+EF 00525 RST 40
2491 21FFFF 00526 LD HL,-1
2494 C9 00527 RET
2495 44 00528 SPCERR$ 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
24AA 00529 FCB1 DS 3 ;Only 3-bytes needed
24AD 00530 FCB2 DS 32
2400 00531 END LINK
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]