; PCPIZ3AS.ASM rev 1.1 Al Heynneman 15 Aug 87 ; -when using VALIAS or TALIAS to create the ; STARTUP file, they would never execute on ; bootup because they didn't know anything ; about the ENV. Version 1.0 just zeroed ; out the ENV area to zeros. Version 1.1 ; now inits the ENV area with some of the ; proper address defaults for the Apple ; running with the PCPI CP/M card. When you ; execute a LDR SYS.ENV, the proper final ; values will be loaded for your specific ; environment and TCAP. ; ; 70110,611 on CompuServe ; CL0798 on the Source ; HEYNNEMAN on Genie ; ; rev 1.0 Jim Lill 01 Mar 87 ; -initial creation for Apple/PCPI CP/M card ; ; This file allows PCPI Applicard ZCPR3 users to make path changes ; in the AUTOST file without having to own MAC or a similar macro ; assembler. ; ; Usage: - Edit as required ; - assemble with ASM ; - load with LOAD ; - rename AUTOST.COM ; ; Adapted from: ; ; AUTOST.ASM ; ; 7/28/84 by Steven Hirsch w/ acknowledgements to Rick Conn!!! ; ; The PCPI BIOS looks for a file called Autost.Com on cold-boot, ; this file, in turn, initializes the system buffers and calls ; STARTUP.COM. STARTUP.COM is an alias which loads the system ; segments and performs any other desired initialization or ; "turnkey" functions. ; ;====================================================================== ; All of the following code moved in from........ ; ; Z3BASE.LIB - Configured for PCPI Appli-Card CP/M, Ver 2.0 ; Z3REV EQU 30 ; ZCPR3 REV NUMBER MSIZE EQU 51 ; SIZE OF TPA ; ; BASE - Base Address of user's CP/M system (normally 0 for DR version) ; This equate allows easy modification by non-standard CP/M (eg,H89) ; BASE EQU 0 ; ; 3. EXTERNAL PATH ; ; The following equates define the address of the ZCPR3 External ; Path and the number of two-byte elements contained in this path (maximum). ; If there is no ZCPR3 External Path, both of these values should be set to 0. ; EXPATH EQU 40H ; EXTERNAL PATH EXPATHS EQU 5 ; 5 2-byte Path Elements ; (PATH SIZE = EXPATHS*2 + 1) ; 4. WHEEL BYTE ; ; The following equate defines the address of the ZCPR3 Wheel Byte. ; If there is no ZCPR3 Wheel Byte, this value should be set to 0. ; Z3WHL EQU 4BH ; WHEEL BYTE ADDRESS ; ; 5. CCP LOCATION ; ; The following equate defines the address of the ZCPR3 Command ; Processor. This address MUST be supplied. ; CCP EQU 0dC00H ; For relocatable system with PCPI AppliCard ; it must Org at DC00h. Actual running position ; will change w/system size!! ; ; 6. RCP LOCATION ; ; The following equates define the address of the ZCPR3 Resident ; Command Package and its size in 128-byte blocks. If there is no ; ZCPR3 Resident Command Package, both of these values should be 0. ; RCP EQU 0F180H ; RESIDENT COMMAND PACKAGE RCPS EQU 16 ; 16 128-byte Blocks (2K bytes) ; ; 7. IOP LOCATION ; ; The following equates define the address of the ZCPR3 Input/Output ; Package and its size in 128-byte blocks. If there is no ZCPR3 Input/Output ; Package, both of these values should be 0. ; IOP EQU 0 ; REDIRECTABLE I/O PACKAGE IOPS EQU 0 ; 12 128-byte Blocks (1.5K bytes) ; ; 8. FCP LOCATION ; ; The following equates define the address of the ZCPR3 Flow Command ; Package and its size in 128-byte blocks. If there is no ZCPR3 Flow Command ; Package, both of these values should be 0. ; FCP EQU 0F980H ;FLOW COMMAND PACKAGE FCPS EQU 4 ; 4 128-byte Blocks (0.5K bytes) ; ; 9. ENV LOCATION ; ; The following equates define the address of the ZCPR3 Environment ; Descriptor and its size in 128-byte blocks. If there is no ZCPR3 Environment ; Descriptor, both of these values should be 0. ; Z3ENV EQU 0FB80H ; ENVIRONMENT DESCRIPTORS Z3ENVS EQU 2 ; SIZE OF ENVIRONMENT DESCRIPTOR IN 128-BYTE BLOCKS ; 10. SHELL STACK ; ; The following equates define the address of the ZCPR3 Shell Stack, ; the number of entries permitted in the ZCPR3 Shell Stack, and the size ; of each entry in the Shell Stack in terms of bytes. If there is no ZCPR3 ; Shell Stack, all three values should be 0. ; SHSTK EQU 0FC80H ; ZCPR3 SHELL STACK SHSTKS EQU 4 ; NUMBER OF SHSIZE-BYTE SHELL STACK ENTRIES SHSIZE EQU 32 ; SIZE OF A SHELL STACK ENTRY ; (STACK SIZE = SHSTKS * SHSIZE) ; 11. ZCPR3 MESSAGES ; ; The following equate defines the address of the ZCPR3 Message Buffer. ; This buffer is always 80 bytes long. If there is no ZCPR3 Message Buffer, ; this address should be 0. ; Z3MSG EQU 0FD00H ; ZCPR3 MESSAGE BUFFER ; ; 12. EXTERNAL FCB ; ; The following equate defines the address of the ZCPR3 External FCB. ; This buffer is always 36 bytes long. If there is no ZCPR3 External FCB, ; this address should be 0. ; EXTFCB EQU 0FD50H ; ZCPR3 EXTERNAL FCB ; ; 13. NAMED DIRECTORY BUFFER ; ; The following equates define the address and size (in terms of 18-byte ; entries) of the ZCPR3 Named Directory Buffer. If there is no such buffer, ; both of these values should be 0. ; Z3NDIR EQU 0FD80H ; ZCPR3 NAMED DIRECTORY AREA Z3NDIRS EQU 14 ; 14 18-byte Named Directory Elements permitted ; (NDIR SIZE = Z3NDIRS*18 + 1 for trailing 0) ; ; 14. COMMAND LINE ; ; The following equates define the address and size (in terms of bytes) ; of the ZCPR3 Command Line Buffer (formerly called the Multiple Command Line ; Buffer under ZCPR2). If there is no such buffer, both of these values should ; be 0. ; Z3CL EQU 0FE80H ; ZCPR3 COMMAND LINE BUFFER Z3CLS EQU 200 ; SIZE OF COMMAND LINE BUFFER ; ; 15. EXTERNAL STACK ; ; The following equate defines the address of the ZCPR3 External Stack. ; This stack is always 48 bytes in size. If there is no such stack, this ; value should be 0. ; EXTSTK EQU 0FF50H ; ZCPR3 EXTERNAL STACK ;* ;* END of ZCPR3 BASE EQUATES ;* IO6502 EQU 0FF80H ; 6502 Bios I/O Routines ; ;======================================================================== ; END of Z3BASE ;======================================================================= ORG BASE + 100H ; ; EQUATES FOR INTIAL PATH SETUP Note: change end of this file too! IDISK1 EQU 'A'-'@' ;These equates set up the intial search- IUSER1 EQU 0 ;path. If STARTUP.COM and/or LDR.COM are IDISK2 EQU 'A'-'@' ;not on A0: BE SURE to place their location IUSER2 EQU 15 ;on the path!! ;IDISK3 EQU 'd:'-'@' ; ;IUSER3 EQU u: ; ;IDISK4 EQU 'd:'-'@' ; ;IUSER4 EQU u: ; ; ; ; INITIALIZE THE PATH BUFFER ; LXI D,PATH LXI H,EXPATH MVI B,9 CALL MOVLOP ; ; SET WHEEL BYTE TO PRIVILIGED STATUS ; (PASSWORD IS NOT REQUIRED) ; MVI A,0FFH STA Z3WHL ; ; INITIALIZE THE RCP BUFFER ; LXI H,RCP CALL ZERO128 ; ; INITIALIZE THE FCP BUFFER ; LXI H,FCP CALL ZERO128 ; ; INITIALIZE THE ENV DESCRIPTOR ; ; LXI H,Z3ENV ; MVI B , 128 + 16 ; CALL ZEROM ; LXI D,ENVINIT ; point to ENV init data LXI H,Z3ENV ; point to ENV address CALL MOVER ; move 128 bytes ; ; INTIIALIZE THE SHELL STACK ; XRA A STA SHSTK ; ; INITIALIZE THE MESSAGE BUFFER ; LXI H , Z3MSG MVI B , 80 CALL ZEROM ; ; INITIALIZE THE NAMED DIRECTORY BUFFER ; LXI H , Z3NDIR CALL ZERO128 ; ; INITIALIZE THE COMMAND LINE BUFFER ; LXI D , CMDSET LXI H , Z3CL CALL MOVER RET ; ; MOVER MOVES 128 BYTES OF DATA. SOURCE POINTER IN DE, DEST. IN HL ; MOVER: MVI B , 128 MOVLOP: LDAX D MOV M , A INX D INX H DCR B JNZ MOVLOP RET ; ; ZERO 128 BYTES POINTED TO BY HL ; ZERO128: MVI B , 128 ; ; ZERO FOR B BYTES WHERE POINTED BY HL ; ZEROM: MVI M , 0 INX H DCR B JNZ ZEROM RET ; ; INITIAL VALUES FOR COMMAND LINE BUFFER AND NAMED DIRECTORY BUFFER ; CMDSET: DW Z3CL + 4 DB Z3CLS DB 0 DB 'STARTUP' ;Run the program (or alias) called DB 0 ;"STARTUP.COM" when control is passed PATH: DB IDISK1,IUSER1 DB IDISK2,IUSER2 ; DB IDISK3,IUSER3 ;Additional search elements (if needed) ; DB IDISK4,IUSER4 ; DB 0 ;END OF PATH ; ; Initial values for ENV descriptor for Apple ][ with PCPI CP/M card. ; ENVINIT: jmp 0 ; because it's inline code ; envorg1: db 'Z3ENV' ; Environment ID db 1 ; class 2 environment (internal) ; class 1 is external dw expath ; external path address db expaths ; number of 2-byte elements in path dw rcp ; RCP address db rcps ; number of 128-byte blocks in RCP dw iop ; IOP address db iops ; number of 128-byte blocks in IOP dw fcp ; FCP address db fcps ; number of 128-byte blocks in FCP dw z3ndir ; NDR address db z3ndirs ; number of 18-byte entries in NDR dw z3cl ; ZCPR3 Command Line db z3cls ; number of bytes in Command Line dw z3env ; ZCPR3 Environment Descriptor db z3envs ; number of 128-byte blocks in Descriptor dw shstk ; Shell Stack address db shstks ; number of shsize-byte entires in Shell Stack db shsize ; size of a Shell Stack entry dw z3msg ; ZCPR3 Message buffer dw extfcb ; ZCPR3 External FCB dw extstk ; ZCPR3 External Stack db 0 ; quiet flag (1=quiet, 0=not quiet) dw z3whl ; address of Wheel Byte db 8 ; Processor Speed in MHz db 'M'-'@' ; maximum disk db 31 ; maximum user db 1 ; 1=OK to accept DU, 0=not OK db 0 ; CRT selection (0=CRT 0, 1=CRT 1) db 0 ; Printer selection (n=Printer n) db 80 ; width of CRT 0 db 24 ; number of lines on CRT 0 db 22 ; number of lines of text on CRT 0 db 132 ; width of CRT 1 db 24 ; number of lines on CRT 1 db 22 ; number of lines of text on CRT 1 db 80 ; width of Printer 0 db 66 ; number of lines on Printer 0 db 58 ; number of lines of text on Printer 0 db 1 ; form feed flag (0=can't formfeed, 1=can) db 102 ; width of Printer 1 db 66 ; number of lines on Printer 1 db 58 ; number of lines of text on Printer 1 db 1 ; form feed flag (0=can't formfeed, 1=can) db 80 ; width of Printer 2 db 66 ; number of lines on Printer 2 db 58 ; number of lines of text on Printer 2 db 0 ; form feed flag (0=can't formfeed, 1=can) db 102 ; width of Printer 3 db 66 ; number of lines on Printer 3 db 58 ; number of lines of text on Printer 3 db 0 ; form feed flag (0=can't formfeed, 1=can) db 'SH ' ; shell variable filename db 'VAR' ; shell variable filetype db ' ' ; filename 1 db ' ' ; filetype 1 db ' ' ; filename 2 db ' ' ; filetype 2 db ' ' ; filename 3 db ' ' ; filetype 3 db ' ' ; filename 4 db ' ' ; filetype 4 ds 80H-($-envorg1+3) ; make exactly 80H bytes long ; (+3 compensates for leading JMP) ; ; End of Environment Descriptor Data ; END