3. S T E P 2 : Z C P R 3 M E M O R Y S T R U C T U R E  3.1. Z3BASE.LIB Thå  filå  Z3BASE.LI  defineó thå memorù structurå  oæ  thå ZCPR³ System®  Thió filå ió "included¢ bù á numbeò oæ thå  ZCPR³ Systeí  Segmentó  wheî  theù arå assembleä iî  ordeò  tï  providå informatioî  tï  theí oî thå memorù structurå oæ thå systeí  theù arå  beinç  assembleä for®  Z3BASE.LI provideó  onå  sourcå  oæ informatioî  abouô  thå targeô ZCPR³ Systeí tï alì utilitieó  anä ZCPR3 System Segments. Z3BASE.LI  ió  divideä  intï twï partsº  (1©  thå  commenô header¬  whicè  outlineó thå memorù structurå oæ thå systeí iî  á manneò similiaò tï Fiç 1-3¬  anä (2© thå body¬  whicè containó  á serieó  oæ  equateó  whicè definå addresseó oæ  elementó  iî  thå systeí  anä  otheò  informatioî abouô variouó attributeó  oæ  thå system. 3.2. Z3BASE Header Thå followinç figurå showó thå commenô headeò oæ thå examplå ZCPR³  Systeí  Z3BASE.LI  file®  Iô  ió  recommendeä  thaô  thå installeò filì ouô thå detailó oæ thå addresó rangå anä  featureó supporteä  iî thå targeô ZCPR³ Systeí iî á Z3BASE.LI filå beforå hå  dï  anù  programminç  anä makå á  copù  oæ  Z3BASE.LI  aó  á reference for himself during the installation process. .pa Š;**************************************************************** ;* Z3BASE.LIB -- Base Addresses for ZCPR3 System by R Conn * ;* * ;* Address Range Size Function * ;* 0 - FF 256 b Standard CP/M Buffers except * ;* 40 - 4A 11 b for ZCPR3 External Path * ;* 4B 1 b Wheel Byte * ;* 100 - BFFF ~48 K TPA * ;* C000 - C7FF 2 K ZCPR3 Command Processor * ;* C800 - D5FF 3.5K BDOSZ * ;* D600 - E3FF 3.5K CBIOSZ with Buffers * ;* E400 - EBFF 2 K Resident Command Package * ;* EC00 - F1FF 1.5K Redirectable I/O Driver Package * ;* F200 - F3FF 0.5K Flow Command Package * ;* F400 - F4FF 256 b Environment Descriptors * ;* Bytes 00H-7FH: Z3 Parameters * ;* Bytes 80H-FFH: Z3 Terminal Cap * ;* F500 - F57F 128 b ZCPR3 Shell Stack * ;* F580 - F5CF 80 b ZCPR3 Message Buffers * ;* Byte 0: Error Flag (Z/NZ) * ;* Byte 1: IF (8 Levels) * ;* Byte 2: IF Active (8 Levels) * ;* Byte 3: Z3 Cmd Status * ;* 00B - Normal * ;* 01B - Shell * ;* 10B - Error * ;* Bytes 4&5: Error Address if 10B * ;* Byte 6: Program Error Code * ;* Byte 7: ZEX Message Byte * ;* 00B - Normal * ;* 01B - Z3 Prompt * ;* 10B - Suspend Intercept * ;* Byte 8: ZEX Running Flag (0=No) * ;* Bytes 9-10: Address of Next * ;* Char for ZEX to Return * ;* Bytes 11-12: Address of First * ;* Char in ZEX Memory- * ;* Based File Buffer * ;* Byte 13: SH Control Byte * ;* Bit 0: Enable SHCMT * ;* Bit 1: Enable SHECHO * ;* Bit 7: Enable Shell * ;* Entry Wait * ;* Bytes 14-15: Shell Scratch * ;* Bytes 10H-2FH: Error Cmd * ;* Bytes 30H-39H: Registers * ;* Bytes 3AH-3FH: Reserved * ;* Bytes 40H-4FH: User-Defined * ;* F5D0 - F5FF 48 b ZCPR3 External FCB * ;* F600 - F6FF 256 b Memory-Based Named Directory * ;* F700 - F7CF 208 b Multiple Command Line Buffer * ;* F7D0 - F7FF 48 b ZCPR3 External Stack * ;* F800 - FFFF 2 K ROM * ;**************************************************************** FIG 3-1: Z3BASE.LIB Comment Header Š 3.3. Z3BASE Body Thå  followinç ió á reformatteä duplicatå oæ thå bodù oæ thå Z3BASE.LI  file®  Iô  ió provideä herå  tï  providå  additionaì informatioî  oî ho÷ tï seô thå equates®  Iô maù bå usefuì tï thå installeò  tï havå thió installatioî manuaì opeî tï  theså  pageó while he is editing the Z3BASE.LIB file. 3.3.1. Version Numbers, Memory Size, and CP/M Base Thå  followinç equateó definå thå versioî numberó oæ  thå ZCPR³  Commanä  Processoò anä thå CBIOSZ®  Theù alsï  explicitlù statå  thå  sizå oæ thå TPÁ foò inclusioî iî  thå  CBIOSÚ  headeò printeä aô Colä Boot. Z3REV EQU 30 ; ZCPR3 REV NUMBER CBREV EQU 41 ; CBIOSZ REV NUMBER MSIZE EQU 48 ; SIZE OF TPA Theså  equateó  arå usuallù useä bù thå BIOÓ tï prinô  theså detailó  iî itó Colä Booô signoî message®  Theù arå noô useä  bù any ZCPR3 System Segments other than the BIOS. BASÅ - Baså Addresó oæ user'ó CP/Í systeí (normallù ° foò  DÒ version)®  Thió  equatå allowó easù modificatioî bù non-standarä CP/Í (eg,H89) BASE EQU 0 Thió  equatå  ió provideä tï establisè  whetheò  á  standarä systeí (ORÇ 0© ió beinç builô oò not¬  and¬ iæ not¬ whaô thå baså address of the system is. 3.3.2. Processor Selection Thå  followinç  equatå selectó thå uså oæ  thå  8080/808µ micrï  oò  thå  Z8° micrï foò thå targeô foò  ZCPR3®  Notå  thaô selectinç  thå 8080/808µ shoulä bå donå ONLÙ iæ yoõ havå aî  808° oò  8085®  Iæ yoõ havå á Z80¬  bù alì meanó seô I808°  tï  FALSÅ sincå thå codå ió mucè smalleò anä yoõ caî puô morå featureó intï thå systeí aó á result. Iæ  thå processoò ió aî 808° oò 8085¬  seô thió equatå tï TRUE® Iæ thå processoò ió á Z80¬ seô iô tï FALSE. I8080 EQU FALSE ZCPR³  caî  bå assembleä tï ruî oî aî  8080¬  8085¬  oò  Z8° microprocessor®  Iæ thió equatå ió FALSE¬  thå Z8° ió  selected¬ and¬ bù usinç relativå jumps¬ morå featureó caî bå packeä iî thaî under an 8080 or 8085. Š 3.3.3. External Path Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Externaì  Patè  anä thå numbeò oæ two-bytå elementó containeä  iî thió patè (maximum)® Iæ therå ió nï ZCPR³ Externaì Path¬ botè oæ theså valueó shoulä bå seô tï 0. EXPATH EQU 40H ; EXTERNAL PATH EXPATHS EQU 5 ; 5 2-byte Path Elements ; (PATH SIZE = EXPATHS*2 + 1) Iæ  nï externaì patè ió tï bå employed¬  seô botè  oæ  theså equateó  tï 0®  ZCPR³ wilì theî reservå spacå withiî itselæ  foò the command-search path. See Section 2.6.1 for more detail. 3.3.4. Wheel Byte Thå  followinç  equatå defineó thå addresó oæ  thå  ZCPR³ Wheeì Byte®  Iæ therå ió nï ZCPR³ Wheeì Byte¬  thió valuå shoulä bå seô tï 0. Z3WHL EQU 4BH ; WHEEL BYTE ADDRESS Iæ  therå ió nï Wheeì Byte¬  seô thió equatå tï 0®  Thå C3È instructioî (JMP© aô memorù locatioî ° wilì bå useä aó thå  Wheeì Bytå  then¬  and¬  beinç non-zero¬  thå Wheeì Bytå wilì alwayó bå TRUE®  Iæ  thió equatå ió seô tï 0¬  bå surå tï noô providå  thå useò witè thå commandó tï changå thió byte¬  since¬  bù sï doing¬ he will wipe out the warm boot jump at location 0. See Section 2.6.2 for more detail. 3.3.5. CCP Location Thå  followinç  equatå defineó thå addresó oæ  thå  ZCPR³ Commanä Processor® Thió addresó MUSÔ bå supplied. CCP EQU 0C000H ; ZCPR3 COMMAND PROCESSOR Thió  valuå caî bå obtaineä bù calculatioî oò bù  usinç  thå Z3LOC utility. .pa Š 3.3.6. RCP Location Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Residenô  Commanä  Packagå anä itó sizå iî 128-bytå  blocks®  Iæ therå ió nï ZCPR³ Residenô Commanä Package¬  botè oæ theså valueó shoulä bå 0. RCP EQU 0E400H ; RESIDENT COMMAND PACKAGE RCPS EQU 16 ; 16 128-byte Blocks (2K bytes) See Section 5.1 for more detail. 3.3.7. IOP Location Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Input/Outpuô  Packagå anä itó sizå iî 128-bytå blocks®  Iæ therå ió nï ZCPR³ Input/Outpuô Package¬  botè oæ theså valueó shoulä bå 0. IOP EQU 0EC00H ; REDIRECTABLE I/O PACKAGE IOPS EQU 12 ; 12 128-byte Blocks (1.5K bytes) See Section 5.3 for more detail. 3.3.8. FCP Location Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Flo÷ Commanä Packagå anä itó sizå iî 128-bytå blocks®  Iæ  therå ió nï ZCPR³ Flo÷ Commanä Package¬  botè oæ theså valueó shoulä bå 0. FCP EQU 0F200H ; FLOW COMMAND PACKAGE FCPS EQU 4 ; 4 128-byte Blocks (0.5K bytes) See Section 5.2 for more detail. 3.3.9. ENV Location Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Environmenô Descriptoò anä itó sizå iî 128-bytå blocks® Iæ therå ió  nï ZCPR³ Environmenô Descriptor¬  botè oæ theså valueó shoulä bå 0. Z3ENV EQU 0F400H ; ENVIRONMENT DESCRIPTORS Z3ENVS EQU 2 ; SIZE OF DESCRIPTOR IN 128-BYTE BLOCKS See Section 2.2.7 for more detail. .pa Š 3.3.10. Shell Stack Thå  followinç  equateó definå thå addresó oæ  thå  ZCPR³ Shelì Stack¬  thå numbeò oæ entrieó permitteä iî thå ZCPR³  Shelì Stack¬  anä thå sizå oæ eacè entrù iî thå Shelì Stacë iî termó oæ bytes® Iæ therå ió nï ZCPR³ Shelì Stack¬ alì threå valueó shoulä bå 0. SHSTK EQU 0F500H ; 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) Thå  totaì  amounô oæ spacå occupieä bù thå shelì  stacë  ió SHSTKS*SHSIZE® Iî thió configuration¬ 12¸ byteó arå useä (4*32). See Section 2.2.6 for more detail. 3.3.11. ZCPR3 Messages Thå  followinç  equatå defineó thå addresó oæ  thå  ZCPR³ Messagå Buffer®  Thió buffeò ió alwayó 8° byteó long®  Iæ therå ió nï ZCPR³ Messagå Buffer¬ thió addresó shoulä bå 0. Z3MSG EQU 0F580H ; ZCPR3 MESSAGE BUFFER See Section 2.2.5 for more detail. 3.3.12. External FCB Thå  followinç  equatå defineó thå addresó oæ  thå  ZCPR³ Externaì FCB®  Thió buffeò ió alwayó 3¶ byteó long® Iæ therå ió nï ZCPR³ Externaì FCB¬ thió addresó shoulä bå 0. EXTFCB EQU 0F5D0H ; ZCPR3 EXTERNAL FCB See Section 2.2.4 for more detail. 3.3.13. Named Directory Buffer Thå  followinç  equateó definå thå addresó anä  sizå  (iî termó  oæ  18-bytå entries© oæ thå ZCPR³ Nameä Directorù  Buffer® Iæ therå ió nï sucè buffer¬ botè oæ theså valueó shoulä bå 0. Z3NDIR EQU 0F600H ; ZCPR3 NAMED DIRECTORY AREA Z3NDIRS EQU 14 ; 14 18-byte Named Directory Elements permitted ; (NDIR SIZE = Z3NDIRS*18 + 1 for trailing 0) See Section 2.2.3 for more detail. .pa Š 3.3.14. Command Line Buffer Thå  followinç  equateó definå thå addresó anä  sizå  (iî termó oæ bytes© oæ thå ZCPR³ Commanä Linå Buffeò (formerlù calleä thå  Multiplå Commanä Linå Buffeò undeò ZCPR2)®  Iæ therå ió  nï sucè buffer¬ botè oæ theså valueó shoulä bå 0. Z3CL EQU 0F700H ; ZCPR3 COMMAND LINE BUFFER Z3CLS EQU 200 ; SIZE OF COMMAND LINE BUFFER See Section 2.2.2 for more detail. 3.3.15. External Stack Thå  followinç  equatå defineó thå addresó oæ  thå  ZCPR³ Externaì Stack® Thió stacë ió alwayó 4¸ byteó iî size® Iæ therå ió nï sucè stack¬ thió valuå shoulä bå 0. EXTSTK EQU 0F7D0H ; ZCPR3 EXTERNAL STACK See Section 2.2.1 for more detail. 3.3.16. User Equates Thå followinç equateó arå availablå foò thå implementer'ó targeô system® Theså arå implementation-defined. DJEPROM EQU 0F800H ; EPROM BASE ADDRESS Thió ió provideä mainlù aó á conveniencå tï thå user®  Thió valuå ió useä bù mù BOOÔ anä BIOS¬  whicè alsï reaä thió filå foò information.