home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / zcat / ldr15.lbr / LDR15.MQC / LDR15.MAC
Text File  |  1991-01-30  |  15KB  |  656 lines

  1. ;
  2. ;  PROGRAM:  LDR
  3. ;  AUTHOR:  RICHARD CONN
  4. ;  VERSION:  1.0
  5. ;  DATE:  27 FEB 84
  6. ;  PREVIOUS VERSIONS:  0.1 (3 Feb 84), 0.2 (22 Feb 84), 1.1 (28 Sep 84)
  7. ;
  8. VERSION        EQU    15    ; Search the path for file to load.
  9.                 ; Joe Wright  2 June 86
  10. ;
  11. ;VERSION    EQU    14    ; V1.4 by steve a. kitahata -- 17-mar-86
  12.  
  13.                 ; This version modified to correct problem in
  14.                 ; The 'load:' routine when loading a package
  15.                 ; That is too large, specifically the tcap.
  16.                 ; Previous versions cleared the first 128 bytes
  17.                 ; Of the memory buffer, and appended a 3-byte
  18.                 ; Error code routine, resulting in whatever
  19.                 ; Resided after the tcap buffer to be zapped.
  20.  
  21. ;version    equ    13    ; This version responds to the quiet flag.
  22.                 ; 11 march 85  joe wright
  23.  
  24. ;VERSION    EQU    12    ; Version 1.2 by Dave Lucky  31 Dec 84
  25.  
  26.                 ; This version modified to correct exit regs from
  27.                 ; Sdload subroutine.  the source and destination
  28.                 ; Registers on entry were hl and de, respectively.
  29.                 ; On exit, they were de and hl.  the calling routine
  30.                 ; (setdata) went amuck when calculating number of ndr
  31.                 ; Records using bogus de.  also, corrected the setdata
  32.                 ; Routine from using the incorrect address of the ndr
  33.                 ; Entry size field as well as its contents acquired
  34.                 ; From the getndr routine.
  35.  
  36. ;VERSION    EQU    11    ; Version 1.1 by Joe Wright  28 Sept 84
  37.  
  38.                 ; This version modified to allow loading the .env
  39.                 ; File the first time, when there is no environment
  40.                 ; Descriptor in memory.  the program now takes
  41.                 ; The environment address from the .env file so
  42.                 ; That subsequent files are also loaded correctly.
  43.                 ; Ie. ldr sys.env,sys.rcp,etc.    note that .env must
  44.                 ; Be the first declared file until ldr is installed
  45.                 ; To your environment.    jww
  46.  
  47. ;VERSION    EQU    10    ; Release version
  48.  
  49. EXTENV    EQU    1        ; 1 for external environ, 0 for internal environ
  50.  
  51. ;
  52. ;    LDR is a general-purpose package loader for ZCPR3.  It is
  53. ; invoked by the following form:
  54. ;
  55. ;        LDR <list of packages>
  56. ;
  57. ; For example:
  58. ;        LDR DEFAULT.RCP,SYSIO.IOP
  59. ;
  60. ;    No default file types are assumed on the list of packages, and
  61. ; each package specified must be unambigous and have a type of RCP or IOP
  62. ; (for Resident Command Package or Input/Output Package).  LDR
  63. ; checks to make sure that the files are valid packages and then loads
  64. ; them into memory at the correct locations, checking for package boundary
  65. ; overflow.
  66. ;
  67. ;
  68.  
  69. ;
  70. ;  ZCPR3 Header
  71. ;
  72.     MACLIB    Z3BASE.LIB
  73.  
  74. ;
  75. ;  System Equates
  76. ;
  77. BDOS    EQU    5
  78. FCB    EQU    5CH
  79. TBUFF    EQU    80H
  80. RCPFLG    EQU    1        ; Package type is rcp
  81. IOPFLG    EQU    2        ; Package type is iop
  82. FCPFLG    EQU    3        ; Package type is fcp
  83. NDRFLG    EQU    4        ; Package type is ndr
  84. ENVFLG    EQU    5        ; Package type is env
  85. TCAPFLG    EQU    6        ; Package type is z3t
  86. CR    EQU    0DH
  87. LF    EQU    0AH
  88.  
  89.     EXT    Z3INIT,ENVPTR,GETQUIET
  90.     EXT    PFIND,RETUD,GETUD,PUTUD,LOGUD
  91.     EXT    GETRCP,GETFCP,GETIOP,GETNDR
  92.     EXT    F$OPEN,F$CLOSE,F$READ
  93.     EXT    PRINT,PFN2
  94.     EXT    HMOVB,MOVEB,FILLB
  95.     EXT    CLINE,SKSP,ZFNAME
  96.  
  97. ;
  98. ;  Environments
  99. ;
  100. ORIGIN:
  101. ;
  102.      IF    EXTENV        ; If external environment ...
  103. ;
  104. ;  External Environment Definition
  105. ;
  106.     JMP    Z3LDR
  107.     DB    'Z3ENV'        ; This is an environment
  108.     DB    1        ; Class 1 environment (external)
  109. ENVLOC:
  110.     DW    Z3ENV        ; Ptr to environment
  111. Z3LDR:
  112.     LHLD    ENVLOC        ; Hl pts to environment
  113.  
  114.      ELSE            ; If internal environment ...
  115. ;
  116. ;  Internal Environment Definition
  117. ;
  118.     MACLIB    SYSENV.LIB
  119. ENVLOC:
  120.     JMP    Z3LDR
  121.     SYSENV            ; Define environment
  122. Z3LDR:
  123.     LXI    H,ENVLOC    ; Hl pts to environment
  124.  
  125.      ENDIF
  126.  
  127. ;
  128. ;  Beginning of LDR
  129. ;
  130.     CALL    Z3INIT        ; Initialize environment pointer
  131.     CALL    BANNER        ; Print banner
  132.     LXI    H,TBUFF        ; Pt to command line
  133.     CALL    CLINE        ; Save command line as string
  134.     CALL    SKSP        ; Skip over spaces
  135.     MOV    A,M        ; Get offending char
  136.     CPI    '/'        ; Help?
  137.     JZ    HELP
  138.     ORA    A        ; Help?
  139.     JZ    HELP
  140. ;
  141. ;  Main Loop - HL pts to next file name in list
  142. ;
  143. Z3LDR1:
  144.     LXI    D,FCB        ; Pt to fcb
  145.     CALL    ZFNAME        ; Extract file name and data
  146.     INX    D        ; Pt to file name
  147. ;
  148.     CALL    GETQUIET
  149.     JNZ    Q0
  150.     CALL    PRINT
  151.     DB    CR,LF,' Loading ',0
  152.     CALL    PFN2        ; Print file name
  153.  
  154. Q0:    PUSH    H        ; Save ptr
  155.     CALL    PKLOAD        ; Load file
  156.     POP    H        ; Get ptr
  157.     MOV    A,M        ; Get char
  158.     INX    H        ; Pt to next char
  159.     CPI    ','        ; Another file in list?
  160.     JZ    Z3LDR1
  161.     RET
  162. ;
  163. ;  Print Help Message
  164. ;
  165. HELP:
  166.     CALL    GETQUIET
  167.     RNZ
  168.     CALL    PRINT
  169.     DB    CR,LF,' LDR Syntax:'
  170.     DB    CR,LF,'   LDR <list of packages/data files>'
  171.     DB    CR,LF,' where entries in the list may be any of these types:'
  172.     DB    CR,LF
  173.     DB    CR,LF,'   FCP - Flow Cmnd Package         ENV - Z3 Environ'
  174.     DB    CR,LF,'   IOP - Input/Output Package      NDR - Z3 Named Dir'
  175.     DB    CR,LF,'   RCP - Resident Cmnd Package     Z3T - Z3TCAP Entry'
  176.     DB    CR,LF,LF,' The package list may have DU: or DIR: references.'
  177.     DB    CR,LF,' If they do not, the path is searched for the package.'
  178.     DB    CR,LF,LF,' The ENV file must be first if LDR is not installed.'
  179.     DB    CR,LF,0
  180.     RET
  181. ;
  182. ;  Load package named in FCB
  183. ;
  184. PKLOAD:
  185.     CALL    SETDATA        ; Load data buffers from environment in case of change
  186.     CALL    CKTYPE        ; Check for valid file type
  187.     JZ    TYPERR        ; Abort if error
  188.     CALL    OPEN        ; Open file, read in first block, check for valid
  189.     JZ    GETUD        ; Abort if error
  190.  
  191. ; Check if ENV.  If so, get Z3ENV and call z3init
  192.  
  193.     PUSH    H        ; Save package pointer from cktype
  194.     LXI    D,FCB+9        ; Fcb type
  195.     LXI    H,ENVTYP    ; Env?
  196.     CALL    COMPTYP        ; Compare types
  197.     POP    H        ; Get package pointer
  198.     JNZ    PKLD        ; Not env, proceed normally
  199. ;
  200. ; File type is ENV.  Get Z3ENV address from file and re-initialize
  201. ;
  202.     LXI    H,TBUFF        ; First sector in tbuff
  203.     LXI    D,1BH        ; Offset to z3env
  204.     DAD    D        ; Point hl to it
  205.     MOV    E,M        ; Get z3env
  206.     INX    H
  207.     MOV    D,M        ; Got it
  208.     XCHG            ; In hl
  209.     CALL    Z3INIT        ; Set new environment
  210.  
  211. PKLD:    CALL    LOAD        ; Load package into memory at correct location
  212.     CALL    CLOSE        ; Close up process
  213.     CALL    GETUD        ; Return home
  214. ;
  215. ;  Check for IOP and return if not
  216. ;
  217.     LDA    PKTYPE        ; Init package if iop
  218.     CPI    IOPFLG
  219.     RNZ
  220. ;
  221. ;  Init IOP
  222. ;
  223.     LHLD    PACKADR        ; Get address
  224.     LXI    D,9        ; 4th jmp into it
  225.     DAD    D
  226.     PUSH    H        ; Address on stack
  227.     RET            ; "call" routine and return to OS
  228. ;
  229. ;  Load Data Buffers from Environment
  230. ;
  231. SETDATA:
  232.     LHLD    ENVPTR        ; Get environment descriptor address
  233.     SHLD    ENVADR
  234.     LXI    D,80H        ; Pt to z3tcap
  235.     DAD    D
  236.     SHLD    TCAPADR
  237.     CALL    GETRCP        ; Get rcp data
  238.     LXI    D,RCPDATA    ; Load
  239.     CALL    SDLOAD
  240.     CALL    GETIOP        ; Get iop data
  241.     LXI    D,IOPDATA    ; Load
  242.     CALL    SDLOAD
  243.     CALL    GETFCP        ; Get fcp data
  244.     LXI    D,FCPDATA    ; Load
  245.     CALL    SDLOAD
  246.     LXI    H,NDRIDAT    ; Init ndr data in case no entry
  247.     LXI    D,NDRDATA
  248.     MVI    B,9        ; 9 bytes (1-jmp, 5-id, 2-adr, 1-size)
  249.     CALL    MOVEB
  250.     CALL    GETNDR        ; Get ndr data
  251.     MOV    B,A        ; Save entry count                ;1284dl
  252.     MOV    A,H        ; No ndr data?
  253.     ORA    L
  254.     RZ
  255.     MOV    A,B        ; Restore entry count                ;1284dl
  256.     CALL    SDLOAD        ; With de -> ndrdata                ;1284dl
  257.     PUSH    D        ; Save ptr to entry count            ;1284dl
  258.     MVI    H,0        ; Hl = value
  259.     MOV    L,A        ; A  = entry count
  260.     DAD    H        ; *2
  261.     MOV    D,H        ; De = value * 2
  262.     MOV    E,L
  263.     DAD    H        ; *4
  264.     DAD    H        ; *8
  265.     DAD    H        ; *16
  266.     DAD    D        ; *18
  267.     MOV    A,H        ; /128
  268.     RLC
  269.     ANI    0FEH
  270.     MOV    H,A
  271.     MOV    A,L
  272.     RLC
  273.     ANI    1
  274.     ORA    H        ; A = value * 18 / 128
  275.     INR    A        ; +1
  276.     POP    D        ; Get ptr
  277.     STAX    D        ; Save value
  278.     RET
  279. ;
  280. ;  Load 3 bytes pted to by HL into memory pted to by DE+6
  281. ;
  282. ;    Input Regs:                            ;1284DL
  283. ;        HL = Source                        ;1284DL
  284. ;        DE = Destination                    ;1284DL
  285. ;                                    ;1284DL
  286. ;    Output Regs:                            ;1284DL
  287. ;        HL = Source                        ;1284DL
  288. ;        DE = Destination+8                    ;1284DL
  289. ;                                    ;1284DL
  290. SDLOAD:
  291.     PUSH    H        ; Save ptr to data
  292.     LXI    H,6        ; Add 6 to de to pt to proper buffer
  293.     DAD    D        ; Hl pts to buffer
  294.     POP    D        ; De contains address
  295.     MOV    M,E        ; Store address
  296.     INX    H
  297.     MOV    M,D
  298.     INX    H
  299.     MOV    M,A        ; Store size data
  300.     XCHG            ; Swap source / destination regs        ;1284dl
  301.     RET
  302. ;
  303. ;  Print Banner
  304. ;
  305. BANNER:
  306.     CALL    GETQUIET
  307.     RNZ
  308.     CALL    PRINT
  309.     DB    CR,LF,'ZCPR3 LDR, Version '
  310.     DB    (VERSION/10)+'0','.',(VERSION MOD 10)+'0',0
  311.     RET
  312. ;
  313. ;  Check for Valid Package File Type
  314. ;    Return with Zero Flag Set if error
  315. ;    If validated, PKTYPE contains package type and HL pts to data
  316. ;
  317. CKTYPE:
  318.     LXI    D,FCB+9        ; Pt to file type
  319.     LXI    H,RCPTYP    ; See if rcp
  320.     MVI    B,RCPFLG    ; Rcp code
  321.     CALL    COMPTYP        ; Compare
  322.     JZ    CKTOK        ; Ok if match
  323.     LXI    H,IOPTYP    ; See if iop
  324.     MVI    B,IOPFLG    ; Iop code
  325.     CALL    COMPTYP        ; Compare
  326.     JZ    CKTOK        ; Ok if match
  327.     LXI    H,FCPTYP    ; See if fcp
  328.     MVI    B,FCPFLG    ; Fcp code
  329.     CALL    COMPTYP        ; Compare
  330.     JZ    CKTOK        ; Ok if match
  331.     LXI    H,NDRTYP    ; See if ndr
  332.     MVI    B,NDRFLG    ; Ndr code
  333.     CALL    COMPTYP        ; Compare
  334.     JZ    CKTOK        ; Ok if match
  335.     LXI    H,ENVTYP    ; See if env
  336.     MVI    B,ENVFLG    ; Env code
  337.     CALL    COMPTYP        ; Compare
  338.     JZ    CKTOK        ; Ok if match
  339.     LXI    H,TCAPTYP    ; See if z3tcap
  340.     MVI    B,TCAPFLG    ; Z3t code
  341.     CALL    COMPTYP        ; Compare
  342.     JZ    CKTOK
  343.     MVI    B,0        ; Invalid type
  344. CKTOK:
  345.     MOV    A,B        ; Set package type
  346.     STA    PKTYPE
  347.     ORA    A        ; Set nz if no error
  348.     RET
  349. COMPTYP:
  350.     PUSH    D        ; Save regs
  351.     PUSH    B
  352.     MVI    B,3        ; 3 bytes
  353. COMPT1:
  354.     LDAX    D        ; Get fcb char
  355.     ANI    7FH        ; Mask
  356.     CMP    M        ; Compare
  357.     JNZ    COMPT2
  358.     INX    H        ; Pt to next
  359.     INX    D
  360.     DCR    B        ; Count down
  361.     JNZ    COMPT1
  362. COMPT2:
  363.     POP    B        ; Restore regs
  364.     POP    D
  365.     RET
  366. TYPERR:
  367.     CALL    GETQUIET
  368.     RNZ
  369.     CALL    PRF        ; Print file name and string
  370.     DB    ' is not a Valid Type',0
  371.     RET
  372. ;
  373. ;    If DU reference is explicit, log into it.  If not, search path.
  374. ;    Open File and Load First Block into TBUFF
  375. ;    Validate Package Structure and Return with Zero Flag Set if Error
  376. ;    On input, HL pts to data buffer
  377. ;    If no error, HL points to load address and B is number of 128-byte
  378. ;        pages allowed in buffer
  379. ;
  380. OPEN:
  381.     CALL    PUTUD        ; Save current DU
  382.     CALL    RETUD        ; Get current DU in BC
  383.     LDA    FCB        ; Get disk
  384.     ORA    A        ; Default?
  385.     JNZ    EXPLICIT    ; Explicit reference, do it.
  386.     LXI    D,FCB
  387.     DCR    A        ; A non-zero
  388.     CALL    PFIND        ; Search current DU, then along path
  389.     JZ    FNFERR        ; Can't find it
  390.     JMP    LOGIT
  391. EXPLICIT:
  392.     MOV    B,A        ; Disk in b (a=1)
  393.     DCR    B        ; Adjust to a=0
  394. OPEN0:
  395.     LDA    FCB+13        ; Get user
  396.     MOV    C,A        ; User in c
  397. LOGIT:
  398.     CALL    LOGUD        ; Log into ud
  399.     XRA    A        ; Clear disk
  400.     STA    FCB
  401.  
  402. ;
  403. ;  Disallow Ambiguous File Name
  404. ;
  405.     CALL    AMBCHK        ; Check for ambiguous file name
  406.     JZ    AMBERR        ; Abort if any ambiguity
  407. ;
  408. ;  Open File
  409. ;
  410.     LXI    D,FCB        ; Pt to fcb
  411.     CALL    F$OPEN        ; Open file
  412.     JNZ    FNFERR        ; Abort if file not found
  413. ;
  414. ;  Read First 128-byte Block
  415. ;
  416.     CALL    F$READ        ; Read in first block
  417.     JNZ    FEMPTY        ; Abort if file empty
  418. ;
  419. ;  Validate Package
  420. ;    Package Data Area is structured as follows:
  421. ;        DB    numjmps ; number of jumps at beginning of package
  422. ;        DB    'Z3xxx' ; package ID (always 5 chars)
  423. ;        DW    address ; address of memory buffer
  424. ;        DB    size    ; number of 128-byte blocks in memory buffer
  425. ;
  426.     XCHG            ; De pts to package data
  427.     LDAX    D        ; Get number of jumps
  428.     INX    D        ; Pt to package id
  429.     MOV    B,A        ; Jump count in b
  430. ;
  431. ;  Validate Package - MUST have proper number of JMPs
  432. ;
  433.     LXI    H,TBUFF        ; Check jumps
  434. OPEN1:
  435.     MOV    A,B        ; At limit of jumps?
  436.     ORA    A
  437.     JZ    OPEN2
  438.     DCR    B        ; Count down
  439.     MOV    A,M        ; Check for jmp
  440.     CPI    0C3H        ; Jmp?
  441.     JNZ    STRERR        ; Structure error
  442.     INX    H        ; Pt to next
  443.     INX    H
  444.     INX    H
  445.     JMP    OPEN1
  446. ;
  447. ;  Check Package ID - must match
  448. ;
  449. OPEN2:
  450.     MVI    B,5        ; Check package id
  451. OPEN3:
  452.     LDAX    D        ; Get byte
  453.     CPI    ' '        ; No id if space
  454.     JZ    OPEN4
  455.     CMP    M        ; Check
  456.     JNZ    STRERR        ; Structure error
  457. OPEN4:
  458.     INX    D        ; Pt to next
  459.     INX    H
  460.     DCR    B        ; Count down
  461.     JNZ    OPEN3
  462. ;
  463. ;  Extract Package Address
  464. ;
  465.     LDAX    D        ; Get low-order address
  466.     MOV    L,A        ; Put in hl
  467.     INX    D
  468.     LDAX    D        ; Get high-order address
  469.     MOV    H,A
  470.     INX    D
  471. ;
  472. ;  Check for Valid Package Address
  473. ;
  474.     MOV    A,H        ; Must not be zero
  475.     ORA    L
  476.     JZ    ADRERR
  477. ;
  478. ;  Extract 128-byte Block Count
  479. ;
  480.     LDAX    D        ; Get block count
  481.     MOV    B,A        ; Put in b
  482.     XRA    A        ; Set flags
  483.     DCR    A        ; Nz
  484.     RET
  485. ;
  486. ;  Ambiguous File Name Check
  487. ;    Returns with Z Set if Ambiguous
  488. ;
  489. AMBCHK:
  490.     LXI    D,FCB+1        ; Check for ambiguous file name
  491.     MVI    B,11        ; 11 chars
  492. AMBCHK1:
  493.     LDAX    D        ; Get char
  494.     ANI    7FH        ; Mask
  495.     CPI    '?'
  496.     RZ
  497.     INX    D        ; Pt to next
  498.     DCR    B        ; Count down
  499.     JNZ    AMBCHK1
  500.     DCR    B        ; Set nz flag
  501.     RET
  502.  
  503. ;
  504. ;  Error Messages
  505. ;
  506. AMBERR:
  507.     CALL    GETQUIET
  508.     JNZ    ERRET
  509.     CALL    PRF        ; Print file name and message
  510.     DB    ' is Ambiguous',0
  511. ERRET:
  512.     XRA    A        ; Set error code
  513.     RET
  514. ADRERR:
  515.     CALL    GETQUIET
  516.     JNZ    ERRET
  517.     CALL    PRF        ; Print file name and message
  518.     DB    ' Not Known to Environ',0
  519.     JMP    ERRET
  520. FNFERR:
  521.     CALL    GETQUIET
  522.     JNZ    ERRET
  523.     CALL    PRF        ; Print file name and message
  524.     DB    ' Not Found',0
  525.     JMP    ERRET
  526. FEMPTY:
  527.     CALL    GETQUIET
  528.     JNZ    ERRET
  529.     CALL    PRF        ; Print file name and message
  530.     DB    ' Empty',0
  531.     JMP    ERRET
  532. STRERR:
  533.     CALL    GETQUIET
  534.     JNZ    ERRET
  535.     CALL    PRF        ; Print file name and message
  536.     DB    ' Contains a Format Flaw',0
  537.     JMP    ERRET
  538. PRF:
  539.     CALL    PRINT
  540.     DB    CR,LF,' File ',0
  541.     LXI    D,FCB+1
  542.     CALL    PFN2
  543.     JMP    PRINT
  544.  
  545. ;
  546. ;  Close File
  547. ;
  548. CLOSE:
  549.     LXI    D,FCB        ; Pt to fcb
  550.     JMP    F$CLOSE        ; Close file
  551.  
  552. ;
  553. ;  Load File Into Buffer
  554. ;
  555. LOAD:
  556.     SHLD    PACKADR        ; Save package address in case of error
  557.     XCHG            ; De pts to buffer, b = max blocks
  558. LOAD1:
  559.     PUSH    B        ; Save count
  560.     LXI    H,TBUFF        ; Pt to buffer
  561.     MVI    B,128
  562.     CALL    HMOVB        ; Copy tbuff into buffer
  563.     PUSH    D        ; Save ptr to next block in buffer
  564.     LXI    D,FCB        ; Pt to fcb
  565.     CALL    F$READ        ; Read next block
  566.     POP    D        ; Get ptr
  567.     POP    B        ; Get count
  568.     RNZ            ; Done if nz
  569.     DCR    B        ; Count down
  570.     JNZ    LOAD1
  571. ;
  572. ;  Buffer Full
  573. ;
  574.     CALL    GETQUIET
  575.     JNZ    Q1
  576.     CALL    PRF
  577.     DB    ' is too Large',0
  578. Q1:    LHLD    PACKADR        ; Clear package
  579.     MVI    B,128        ; Nops
  580.     XRA    A
  581.     CALL    FILLB
  582. ;    lxi    b,128    ; pt to after last NOP        [sak]
  583.     LXI    B,128-ERCSIZ    ; [sak]
  584.     DAD    B
  585.     MVI    B,3        ; Copy 3 bytes
  586.     XCHG            ; De pts to empty space
  587.     LXI    H,ERCODE    ; Store error code
  588.     JMP    MOVEB
  589. ;
  590. ;  Error Code to be Stored if Package Load Fails
  591. ;
  592. ERCODE:
  593.     XRA    A        ; 3 bytes
  594.     DCR    A        ; A=0ffh and nz flag set
  595.     RET
  596.  
  597. ERCSIZ    EQU    $-ERCODE    ; [sak]
  598. ;
  599. ;  Buffers
  600. ;
  601. NDRIDAT:
  602.     DB    0        ; No jmps
  603.     DB    '     '        ; No id stored
  604.     DW    0        ; Address
  605.     DB    0        ; (z3ndirs*18)/128+1 size
  606. RCPTYP:
  607.     DB    'RCP'        ; File type of rcp file
  608. RCPDATA:
  609.     DB    0        ; 0 jmps
  610.     DB    'Z3RCP'        ; Id
  611.     DW    0        ; Address
  612.     DB    0        ; Size
  613. IOPTYP:
  614.     DB    'IOP'        ; File type of iop file
  615. IOPDATA:
  616.     DB    16        ; 16 jmps
  617.     DB    'Z3IOP'        ; Id
  618.     DW    0        ; Address
  619.     DB    0        ; Size
  620. FCPTYP:
  621.     DB    'FCP'        ; File type of fcp file
  622. FCPDATA:
  623.     DB    0        ; 0 jmps
  624.     DB    'Z3FCP'        ; Id
  625.     DW    0        ; Address
  626.     DB    0        ; Size
  627. NDRTYP:
  628.     DB    'NDR'        ; File type of ndr file
  629. NDRDATA:
  630.     DB    0        ; No jmps
  631.     DB    '     '        ; No id stored
  632.     DW    0        ; Address
  633.     DB    0        ; (z3ndirs*18)/128+1 size
  634. ENVTYP:
  635.     DB    'ENV'        ; File type of env file
  636. ENVDATA:
  637.     DB    1        ; 1 jmp
  638.     DB    'Z3ENV'        ; Id
  639. ENVADR:
  640.     DW    0        ; Address
  641.     DB    2        ; 2 128-byte blocks max
  642. TCAPTYP:
  643.     DB    'Z3T'        ; File type of z3tcap file
  644. TCAPDATA:
  645.     DB    0        ; No jmps
  646.     DB    '     '        ; No id stored
  647. TCAPADR:
  648.     DW    0        ; Address
  649.     DB    1        ; 1 128-byte block max
  650. PKTYPE:
  651.     DS    1        ; Package type (0=error)
  652. PACKADR:
  653.     DS    2        ; Package address
  654.  
  655.     END
  656.