home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / apple / pcpias11.azm / PCPIAS11.ASM
Encoding:
Assembly Source File  |  1987-08-15  |  10.6 KB  |  404 lines

  1. ; PCPIZ3AS.ASM          rev 1.1         Al Heynneman    15 Aug 87
  2. ;            -when using VALIAS or TALIAS to create the
  3. ;             STARTUP file, they would never execute on
  4. ;             bootup because they didn't know anything
  5. ;             about the ENV.  Version 1.0 just zeroed
  6. ;             out the ENV area to zeros.  Version 1.1
  7. ;             now inits the ENV area with some of the
  8. ;             proper address defaults for the Apple
  9. ;             running with the PCPI CP/M card.  When you
  10. ;             execute a LDR SYS.ENV, the proper final
  11. ;             values will be loaded for your specific
  12. ;             environment and TCAP.
  13. ;
  14. ;             70110,611 on CompuServe
  15. ;             CL0798 on the Source
  16. ;             HEYNNEMAN on Genie
  17. ;
  18. ;            rev 1.0      Jim Lill        01 Mar 87
  19. ;            -initial creation for Apple/PCPI CP/M card
  20. ;            
  21. ; This file allows PCPI Applicard ZCPR3 users to make path changes
  22. ; in the AUTOST file without having to own MAC or a similar macro
  23. ; assembler.
  24. ;
  25. ; Usage: - Edit as required
  26. ;     - assemble with ASM
  27. ;     - load with LOAD
  28. ;     - rename AUTOST.COM
  29. ;
  30. ; Adapted from:
  31. ;
  32. ;    AUTOST.ASM
  33. ;
  34. ;    7/28/84 by Steven Hirsch w/ acknowledgements to Rick Conn!!!
  35. ;
  36. ;    The PCPI BIOS looks for a file called Autost.Com on cold-boot,
  37. ;    this file, in turn, initializes the system buffers and calls
  38. ;    STARTUP.COM. STARTUP.COM is an alias which loads the system
  39. ;    segments and performs any other desired initialization or 
  40. ;    "turnkey" functions.
  41. ;
  42. ;======================================================================
  43. ; All of the following code moved in from........
  44. ;
  45. ; Z3BASE.LIB - Configured for PCPI Appli-Card CP/M, Ver 2.0
  46. ;
  47. Z3REV    EQU    30    ; ZCPR3 REV NUMBER
  48. MSIZE    EQU    51    ; SIZE OF TPA
  49. ;
  50. ;    BASE - Base Address of user's CP/M system (normally 0 for DR version)
  51. ;           This equate allows easy modification by non-standard CP/M (eg,H89)
  52. ;
  53. BASE    EQU    0
  54.  
  55. ;
  56. ;  3. EXTERNAL PATH
  57. ;
  58. ;    The following equates define the address of the ZCPR3 External
  59. ; Path and the number of two-byte elements contained in this path (maximum).
  60. ; If there is no ZCPR3 External Path, both of these values should be set to 0.
  61. ;
  62. EXPATH    EQU    40H    ; EXTERNAL PATH
  63. EXPATHS    EQU    5    ; 5 2-byte Path Elements
  64.             ;  (PATH SIZE = EXPATHS*2 + 1)
  65.  
  66. ;  4. WHEEL BYTE
  67. ;
  68. ;    The following equate defines the address of the ZCPR3 Wheel Byte.
  69. ; If there is no ZCPR3 Wheel Byte, this value should be set to 0.
  70. ;
  71. Z3WHL    EQU    4BH    ; WHEEL BYTE ADDRESS
  72. ;
  73. ;  5. CCP LOCATION
  74. ;
  75. ;    The following equate defines the address of the ZCPR3 Command
  76. ; Processor.  This address MUST be supplied.
  77. ;
  78. CCP    EQU    0dC00H    ; For relocatable system with PCPI AppliCard 
  79.             ; it must Org at DC00h. Actual running position
  80.             ; will change w/system size!!
  81. ;
  82. ;  6. RCP LOCATION
  83. ;
  84. ;    The following equates define the address of the ZCPR3 Resident
  85. ; Command Package and its size in 128-byte blocks.  If there is no
  86. ; ZCPR3 Resident Command Package, both of these values should be 0.
  87. ;
  88. RCP    EQU    0F180H    ; RESIDENT COMMAND PACKAGE
  89. RCPS    EQU    16    ; 16 128-byte Blocks (2K bytes)
  90. ;
  91. ;  7. IOP LOCATION
  92. ;
  93. ;    The following equates define the address of the ZCPR3 Input/Output
  94. ; Package and its size in 128-byte blocks.  If there is no ZCPR3 Input/Output
  95. ; Package, both of these values should be 0.
  96. ;
  97. IOP    EQU    0    ; REDIRECTABLE I/O PACKAGE
  98. IOPS    EQU    0    ; 12 128-byte Blocks (1.5K bytes)
  99. ;
  100. ;  8. FCP LOCATION
  101. ;
  102. ;    The following equates define the address of the ZCPR3 Flow Command
  103. ; Package and its size in 128-byte blocks.  If there is no ZCPR3 Flow Command
  104. ; Package, both of these values should be 0.
  105. ;
  106. FCP    EQU    0F980H    ;FLOW COMMAND PACKAGE
  107. FCPS    EQU    4    ; 4 128-byte Blocks (0.5K bytes)
  108. ;
  109. ;  9. ENV LOCATION
  110. ;
  111. ;    The following equates define the address of the ZCPR3 Environment
  112. ; Descriptor and its size in 128-byte blocks.  If there is no ZCPR3 Environment
  113. ; Descriptor, both of these values should be 0.
  114. ;
  115. Z3ENV    EQU    0FB80H    ; ENVIRONMENT DESCRIPTORS
  116. Z3ENVS    EQU    2    ; SIZE OF ENVIRONMENT DESCRIPTOR IN 128-BYTE BLOCKS
  117.  
  118. ; 10. SHELL STACK
  119. ;
  120. ;    The following equates define the address of the ZCPR3 Shell Stack,
  121. ; the number of entries permitted in the ZCPR3 Shell Stack, and the size
  122. ; of each entry in the Shell Stack in terms of bytes.  If there is no ZCPR3
  123. ; Shell Stack, all three values should be 0.
  124. ;
  125. SHSTK    EQU    0FC80H    ; ZCPR3 SHELL STACK
  126. SHSTKS    EQU    4    ; NUMBER OF SHSIZE-BYTE SHELL STACK ENTRIES
  127. SHSIZE    EQU    32    ; SIZE OF A SHELL STACK ENTRY
  128.             ;   (STACK SIZE = SHSTKS * SHSIZE)
  129. ; 11. ZCPR3 MESSAGES
  130. ;
  131. ;    The following equate defines the address of the ZCPR3 Message Buffer.
  132. ; This buffer is always 80 bytes long.  If there is no ZCPR3 Message Buffer,
  133. ; this address should be 0.
  134. ;
  135. Z3MSG    EQU    0FD00H    ; ZCPR3 MESSAGE BUFFER
  136. ;
  137. ; 12. EXTERNAL FCB
  138. ;
  139. ;    The following equate defines the address of the ZCPR3 External FCB.
  140. ; This buffer is always 36 bytes long.  If there is no ZCPR3 External FCB,
  141. ; this address should be 0.
  142. ;
  143. EXTFCB    EQU    0FD50H    ; ZCPR3 EXTERNAL FCB
  144. ;
  145. ; 13. NAMED DIRECTORY BUFFER
  146. ;
  147. ;    The following equates define the address and size (in terms of 18-byte
  148. ; entries) of the ZCPR3 Named Directory Buffer.  If there is no such buffer,
  149. ; both of these values should be 0.
  150. ;
  151. Z3NDIR    EQU    0FD80H    ; ZCPR3 NAMED DIRECTORY AREA
  152. Z3NDIRS    EQU    14    ; 14 18-byte Named Directory Elements permitted
  153.             ;   (NDIR SIZE = Z3NDIRS*18 + 1 for trailing 0)
  154. ;
  155. ; 14. COMMAND LINE
  156. ;
  157. ;    The following equates define the address and size (in terms of bytes)
  158. ; of the ZCPR3 Command Line Buffer (formerly called the Multiple Command Line
  159. ; Buffer under ZCPR2).  If there is no such buffer, both of these values should
  160. ; be 0.
  161. ;
  162. Z3CL    EQU    0FE80H    ; ZCPR3 COMMAND LINE BUFFER
  163. Z3CLS    EQU    200    ; SIZE OF COMMAND LINE BUFFER
  164. ;
  165. ; 15. EXTERNAL STACK
  166. ;
  167. ;    The following equate defines the address of the ZCPR3 External Stack.
  168. ; This stack is always 48 bytes in size.  If there is no such stack, this
  169. ; value should be 0.
  170. ;
  171. EXTSTK    EQU    0FF50H    ; ZCPR3 EXTERNAL STACK
  172. ;*
  173. ;*  END of ZCPR3 BASE EQUATES
  174. ;*
  175. IO6502    EQU    0FF80H    ; 6502 Bios I/O Routines
  176. ;
  177. ;========================================================================
  178. ; END of Z3BASE
  179. ;=======================================================================
  180.  
  181.     ORG    BASE + 100H
  182. ;
  183. ; EQUATES FOR INTIAL PATH SETUP    Note: change end of this file too!
  184.  
  185. IDISK1    EQU    'A'-'@'        ;These equates set up the intial search-
  186. IUSER1    EQU    0        ;path. If STARTUP.COM and/or LDR.COM are
  187. IDISK2    EQU    'A'-'@'     ;not on A0: BE SURE to place their location
  188. IUSER2    EQU    15        ;on the path!!
  189. ;IDISK3    EQU    'd:'-'@'    ;
  190. ;IUSER3    EQU    u:          ;
  191. ;IDISK4    EQU    'd:'-'@'    ;
  192. ;IUSER4    EQU    u:        ;
  193. ;
  194.  
  195. ;
  196. ;    INITIALIZE THE PATH BUFFER
  197. ;
  198.     LXI    D,PATH
  199.     LXI    H,EXPATH
  200.     MVI    B,9
  201.     CALL    MOVLOP
  202. ;
  203. ;    SET WHEEL BYTE TO PRIVILIGED STATUS
  204. ;    (PASSWORD IS NOT REQUIRED)
  205. ;
  206.  
  207.     MVI    A,0FFH
  208.     STA    Z3WHL
  209. ;
  210. ;    INITIALIZE THE RCP BUFFER 
  211. ;
  212.     LXI    H,RCP
  213.     CALL    ZERO128
  214. ;
  215. ;    INITIALIZE THE FCP BUFFER
  216. ;
  217.     LXI    H,FCP
  218.     CALL    ZERO128
  219. ;
  220. ;    INITIALIZE THE ENV DESCRIPTOR
  221. ;
  222. ;    LXI    H,Z3ENV
  223. ;    MVI    B , 128 + 16
  224. ;    CALL    ZEROM
  225. ;
  226.     LXI    D,ENVINIT    ; point to ENV init data
  227.     LXI    H,Z3ENV        ; point to ENV address
  228.     CALL    MOVER        ; move 128 bytes
  229. ;
  230. ;    INTIIALIZE THE SHELL STACK
  231. ;
  232.     XRA    A
  233.     STA    SHSTK
  234. ;
  235. ;    INITIALIZE THE MESSAGE BUFFER
  236. ;
  237.     LXI    H , Z3MSG
  238.     MVI    B , 80
  239.     CALL    ZEROM
  240. ;
  241. ;    INITIALIZE THE NAMED DIRECTORY BUFFER
  242. ;
  243.     LXI    H , Z3NDIR
  244.     CALL    ZERO128
  245. ;
  246. ;    INITIALIZE THE COMMAND LINE BUFFER
  247. ;
  248.     LXI    D , CMDSET
  249.     LXI    H , Z3CL
  250.     CALL    MOVER
  251.  
  252.     RET
  253.  
  254. ;
  255. ;    MOVER MOVES 128 BYTES OF DATA. SOURCE POINTER IN DE, DEST. IN HL
  256. ;
  257. MOVER:
  258.     MVI    B , 128
  259. MOVLOP:
  260.     LDAX    D
  261.     MOV    M , A
  262.     INX    D
  263.     INX    H
  264.     DCR    B
  265.     JNZ    MOVLOP
  266.     RET
  267.  
  268.  
  269. ;
  270. ;    ZERO 128 BYTES POINTED TO BY HL
  271. ;
  272. ZERO128:
  273.     MVI    B , 128
  274. ;
  275. ;    ZERO FOR B BYTES WHERE POINTED BY HL
  276. ;
  277. ZEROM:
  278.     MVI    M , 0
  279.     INX    H
  280.     DCR    B
  281.     JNZ    ZEROM
  282.     RET
  283. ;
  284. ;    INITIAL VALUES FOR COMMAND LINE BUFFER AND NAMED DIRECTORY BUFFER
  285. ;
  286. CMDSET:
  287.     DW    Z3CL + 4
  288.     DB    Z3CLS
  289.     DB    0
  290.     DB    'STARTUP'    ;Run the program (or alias) called 
  291.     DB    0        ;"STARTUP.COM" when control is passed
  292.  
  293. PATH:
  294.     DB    IDISK1,IUSER1
  295.     DB    IDISK2,IUSER2
  296. ;    DB    IDISK3,IUSER3    ;Additional search elements (if needed)
  297. ;    DB    IDISK4,IUSER4    ;
  298.     DB    0        ;END OF PATH
  299. ;
  300. ;  Initial values for ENV descriptor for Apple ][ with PCPI CP/M card.
  301. ;
  302. ENVINIT:
  303.     jmp    0        ; because it's inline code
  304. ;
  305. envorg1:
  306.     db    'Z3ENV'        ; Environment ID
  307.     db    1        ; class 2 environment (internal)
  308.                 ; class 1 is external
  309.     dw    expath        ; external path address
  310.     db    expaths        ; number of 2-byte elements in path
  311.  
  312.     dw    rcp        ; RCP address
  313.     db    rcps        ; number of 128-byte blocks in RCP
  314.  
  315.     dw    iop        ; IOP address
  316.     db    iops        ; number of 128-byte blocks in IOP
  317.  
  318.     dw    fcp        ; FCP address
  319.     db    fcps        ; number of 128-byte blocks in FCP
  320.  
  321.     dw    z3ndir        ; NDR address
  322.     db    z3ndirs        ; number of 18-byte entries in NDR
  323.  
  324.     dw    z3cl        ; ZCPR3 Command Line
  325.     db    z3cls        ; number of bytes in Command Line
  326.  
  327.     dw    z3env        ; ZCPR3 Environment Descriptor
  328.     db    z3envs        ; number of 128-byte blocks in Descriptor
  329.  
  330.     dw    shstk        ; Shell Stack address
  331.     db    shstks        ; number of shsize-byte entires in Shell Stack
  332.     db    shsize        ; size of a Shell Stack entry
  333.  
  334.     dw    z3msg        ; ZCPR3 Message buffer
  335.  
  336.     dw    extfcb        ; ZCPR3 External FCB
  337.  
  338.     dw    extstk        ; ZCPR3 External Stack
  339.  
  340.     db    0        ; quiet flag (1=quiet, 0=not quiet)
  341.  
  342.     dw    z3whl        ; address of Wheel Byte
  343.  
  344.     db    8        ; Processor Speed in MHz
  345.  
  346.     db    'M'-'@'        ; maximum disk
  347.     db    31        ; maximum user
  348.  
  349.     db    1        ; 1=OK to accept DU, 0=not OK
  350.  
  351.     db    0        ; CRT selection (0=CRT 0, 1=CRT 1)
  352.     db    0        ; Printer selection (n=Printer n)
  353.  
  354.     db    80        ; width of CRT 0
  355.     db    24        ; number of lines on CRT 0
  356.     db    22        ; number of lines of text on CRT 0
  357.  
  358.     db    132        ; width of CRT 1
  359.     db    24        ; number of lines on CRT 1
  360.     db    22        ; number of lines of text on CRT 1
  361.  
  362.     db    80        ; width of Printer 0
  363.     db    66        ; number of lines on Printer 0
  364.     db    58        ; number of lines of text on Printer 0
  365.     db    1        ; form feed flag (0=can't formfeed, 1=can)
  366.  
  367.     db    102        ; width of Printer 1
  368.     db    66        ; number of lines on Printer 1
  369.     db    58        ; number of lines of text on Printer 1
  370.     db    1        ; form feed flag (0=can't formfeed, 1=can)
  371.  
  372.     db    80        ; width of Printer 2
  373.     db    66        ; number of lines on Printer 2
  374.     db    58        ; number of lines of text on Printer 2
  375.     db    0        ; form feed flag (0=can't formfeed, 1=can)
  376.  
  377.     db    102        ; width of Printer 3
  378.     db    66        ; number of lines on Printer 3
  379.     db    58        ; number of lines of text on Printer 3
  380.     db    0        ; form feed flag (0=can't formfeed, 1=can)
  381.  
  382.     db    'SH      '    ; shell variable filename
  383.     db    'VAR'        ; shell variable filetype
  384.  
  385.     db    '        '    ; filename 1
  386.     db    '   '        ; filetype 1
  387.  
  388.     db    '        '    ; filename 2
  389.     db    '   '        ; filetype 2
  390.  
  391.     db    '        '    ; filename 3
  392.     db    '   '        ; filetype 3
  393.  
  394.     db    '        '    ; filename 4
  395.     db    '   '        ; filetype 4
  396.  
  397.     ds    80H-($-envorg1+3)    ; make exactly 80H bytes long
  398.                     ; (+3 compensates for leading JMP)
  399. ;
  400. ;  End of Environment Descriptor Data
  401. ;
  402.     END
  403.  
  404.