Title Program Loader for the MD-11 using CP/M 3 (10_Feb_84) ; ; Copyright 1984 ; Morrow Designs, Inc ; San Leandro, Ca. .z80 aseg org 0100h ; This program allows you to batch command strings to the ; Ims facility. Additionally, you have the option to check for the ; existance of a file before the ims string is submitted which allows ; you to do validity checks. ; There are two major data structures that are used to drive this ; program. The first is a parameter block kept in page zero while the ; program is running. It consists of an ID word followed by the current ; iteration (0 to n) followed by the maximum number of iterations. ; The second data structure is a two dimensional array. The first ; dimension is set by the iteration counter. ; Index: (5_Feb_84) ;------------------ ; ; Main - Main Line ; CclChk - Check the Cbios Compatibility Level ; ChkErr - Check for errors in Previous transfers ; GetDsk - Check for the existance of the key file ; PutIMS - Put the Ims string into the IMS buffer ; GetBas - Return a Pointer to the Desired Entry ; GetRsp - Get the User's Response ; GetBuf - Move system memory into the local buffer ; PutBuf - Put the Local Buffer into System Memory ; DoCold - Call the Bios Cold Boot Entry Point ; -- - General Parameters ; -- - Program Load List ; -- - Prompt Strings ; -- - Error Messages page 64 ;---------------------------------------------------------------------- ; Equates (10_Feb_84) ;------------------- ; ; IDs and Rev Numbers ;-------------------- ; CpmVer equ 30h ;Cpm Version Number ccl equ 0 ;Cbios Compatibility Level Prev equ 11h ;Program revision number PID equ 'Ok' ;Program ID ; Drive Designations for Key filespec prompt strings ;--------------------------------------------------- ; X_Drive equ 0 ;Current Drive A_Drive equ 1 ;Drive A: B_Drive equ 2 ;Drive B: C_Drive equ 3 ;Drive C: Null equ 0FFh ;Null Key filespec prompt ; Address Definitions ;-------------------- ; Wboot equ 0 ;Address of the Start of the BIOS + 3 warmbt equ 01h ;Address of the Bios Warm boot entry bdos equ 05h ;Address of the start of the BDOS IBuf equ 80h ;tail buffer location PIDadd equ 40h ;Address of the ID word LodOff equ 42h ;Current Program Load offset LodMax equ 43h ;Maximum number of load files ErrFlag equ 44h ;Error Flag ; Bdos Function Numbers ;---------------------- ; conin equ 1 ;Console Input a Character ConOut equ 2 ;Console Output a Character DirIO equ 6 ;Direct console control print equ 9 ;Print a string GetRev equ 0Ch ;Get the revision number of this cpm system sfirst equ 11h ;Search for the first occurance of file x delete equ 13h ;Delete a file(s) setdma equ 1Ah ;Set the DMA Address InWait equ 0FDh ;Direct console input (waits until char ready) InjIMS equ 11 ;Extended Function - Inject IMS String ; Offsets ;-------- ; CclOff equ 7 ;Offset to Clevel from start of char. struct. KeyOff equ 0 ;Key File Offset ImsOff equ 2 ;Ims Sting Offset ; Non Printing Ascii Character Equates ;------------------------------------- ; CntrlC equ 3 ;Control C Code (Warm Boot) bell equ 7 ;Bell Code tab equ 9 ;Tab lf equ 0Ah ;Line Feed cr equ 0Dh ;Carriage Return PCr equ 8Dh ;Pause carriage return (see PutIMS) ClrScr equ 1Ah ;Clear Screen Esc equ 1Bh ;Escape Bright equ '(' ;Start High Lighting Dim equ ')' ;Start Low Lighting page ;---------------------------------------------------------------------- ; MAIN - Main Line (5_Feb_84) ;---------------------------- ; Main: ld hl,(PIDadd) ;HL:= Contents of the ID word location ld de,PID ;DE:= Program ID word or a ;(Clear carry) sbc hl,de ;If (ID hasn't been written) jr z,MSkp1 call CclChk ; Check CP/M rev and compatibility level or a ; If (Rev levels aren't high enough) jr nz,Mdone ; Quit ld de,Prmpt1 ld c,Print call Bdos ; Print the initial prompt call GetRsp ; Get the user response or a ; If (Response eq Stop) jr nz,MDone ; Quit ld de,PID The MD-11 Character Table (18_Apr_84) Copyright 1984 Morrow Designs, Inc. San Leandro, Ca. The character table is located at the very beginning of the bios. The only code preceeding it is the boot entry jump. The character table can be read using the extended bios function call 6 (see documentation on extended bios function calls). The character tables contains the following information: Serial Device Initialization -Default Serial Baud Rates -Initial value of CFlag (see the definition of the bits in CFlag at the end of this document) System Configuration Data -Misc information concerning revisions and data locations Terminal Translation Vector Table -A set of pointers for control/escape character translations and direct cursor addressing Direct Cursor Addressing Data -All of the information needed to translate direct cursor address sequences. ;---------------------------------------------------------------------- ; Character Table ;---------------- ; The following code has been extracted from the Morrow Designs Cbios ; for the MD-11 rev 1.8. This code is provided as a reference so that ; you can get a feel for the information contained in the character ; table. Before altering the character table in your own system you ; should look at your copy of BNKBIOS3.MAC for the values current on ; your system. ; char_tables: ; Serial Device Initialization Data ;---------------------------------- ; ser1baud: db dflt1 ;Defaults are defined in the local ser2baud: db dflt2 ; system equates section. ser3baud: db dflt3 default_cflag: db 23h ;translations are on ; System Configuration Data ;-------------------------- ; vnumb: db drives ;number of physical drives tlev: db 4 ;terminal level (default=not installed) ds 3,0 ;reserved db BioRev ;BIOS Revision Number db clevel ;compatibility level dw APIF ;Pointer to Application Interface Area dw ramdaty ;Pointer to RamdatY dw ramdaty + MToff ;Pointer to the base of the first MTAB dw pool ;Pointer to free space ; Terminal Translation Vector Table ;---------------------------------- ; etblptr: dw esctbl ctblptr: dw ctrltbl evctptr: dw escvect cvctptr: dw ctvect dw dcastrt ; Direct Cursor Addressing Data ;------------------------------ ; dcastrt: db 1bh,3dh,0ffh ;dca prefix string ds 3,0ffh dcamid: ds 6,0ffh ;dca seperator dcaend: ds 6,0ffh ;dca terminator string esc_lvl: db 0 ;indicates esc sequence level offset1: db 0 ;first character offset offset2: db 0 ;second character offset order: db 0 ;bit 0 = 0 --> row, then column, ; = 1 --> column, then row ;bit 1 = 0 --> binary cursor adresses ; 1 --> ascii cursor addresses first: db 0 ; temporary storage of first second: db 0 ; temporary storage of second char_table_length equ $-char_tables ;--------------------------- ; End of the Character Table ;---------------------------------------------------------------------- ;Baud Rate Table Definitions ;--------------------------- ; These are the values placed in ser1baud, ser2baud and ser3baud. ; ; Value Resulting Baud Rate 0 110 1 300 2 600 3 1200 4 2400 5 4800 6 9600 7 19,200 ;Cflag Bit-Flag Definitions ;-------------------------- ; The Default Value is 23h (@xl_in, @xl_out and cenlst all on) ; Name Bit Function ---- --- -------- @xl_in 0 Translate input function keys @xl_out 1 Translate output controls & escapes @funact 2 Function key IMS flag (1=active) @siosyn 3 Hardware handshake for SIO @hwsync 4 Hardware handshake for list device @cenlst 5 Centronics is list device @imsact 6 In memory submit flag (1=sub active) @imswet 7 IMS buffer full (1=buffer has chars) ating) ld a,0FFh ; pop bc ret ;Else Return (Rotating) CrNo: ld a,0 pop bc ret ;(Failure Return - Not RotaProblem Report - MD-11 (4_Apr_84) --------------------------------- Problem Area: Using Long Function Key Definitions with NewWord Programs Effected: NW.COM Nature of the Problem:       Aó  oæ  releaså 1.¸ oæ thå MD-1± Bioó thå consolå  statuó  functioî      wilì  returî  TRUÅ iæ á Functioî Keù Strinç ió beinç processed®  Iæ  Ne÷      Worä haó beeî installeä witè thå Consolå X-On/X-Ofæ optioî active¬  theî      iô  wilì  monitoò  thå Consolå Inpuô Statuó  whilå  doinç  consolå  I/O¬      lookinç  foò  X-On/X-Ofæ characters®  Everù timå NW.COÍ getó  aî  activå      valuå bacë froí á consolå inpuô statuó querù iô readó thå nexô characteò      froí  thå  inpuô  buffeò  tï seå iæ itó  aî  X-On/X-Ofæ  character®  Anù      characteò  otheò thaî aî X-On/X-Ofæ characteò ió throwî away®  Thió  caî      causå  charactreró  tï bå inadvertintlù removeä froí  thå  Functioî  Keù      String® Thå defaulô installatioî foò manù terminaló includeó settinç thå      X-On/X-Off protocol to active (just what you DON'T want!). How to Fix the Problem:       Iæ  Ne÷  Worä haó beeî configureä foò X-On/X-Ofæ protocoì theî  iô      wilì occassionallù checë thå consolå statuó foò aî X-Oî  character®  Tï      remedù  thió  yoõ musô re:instalì nw.coí witè thå  X-On/X-Ofæ  protocoì      disabled®  Firsô  ruî  thå  NSMORROW.COÍ program®  Selecô  thå  È  menõ      (Speciaì  Patches©  optioî Å (X-On/X-Ofæ  protocol)®  Thå  installatioî      prograí  wilì  displaù somå informatioî abouô ho÷ tï makå  changeó  anä      theî  displaù  thå  currenô speciaì patcè valueó aô thå bottoí  oæ  thå      screen®  Thå  Firsô valuå wilì bå eitheò 0° oò FFh®  Iæ itó 0° theî  X-      On/X-Ofæ  ió currentlù disableä anä you'vå nothinç elså tï do®  Iæ  thå      valuå ió 0FFè theî Changå iô tï zerï bù typinç 0° followeä bù á  perioä      tï  indicatå thå enä oæ modifications®  No÷ typå X'ó tï returî tï  thå      maiî menu anä exit. .pa ŠProblem Area: Multiple Line Function Key Definitions passed to the CCP Programs Effected: none Nature of the Problem:       Aó  oæ  releaså 1.¸ oæ thå MD-1± Bioó thå consolå statuó  functioî      wilì  returî  TRUÅ  iæ á Functioî Keù Strinç  ió  beinç  processed®  Thå      Consolå  Commanä Processoò iî CP/Í monitoró thå consolå inpuô statuó  aó      iô  printó  lines®  Wheî  thå Consolå Inpuô Statuó ió  activå  theî  thå      characteò ió removeä froí thå consolå inpuô buffeò tï seå iæ itó á Stop-      Scrolì  Character®  Characteró  otheò thaî Stop-Scrolì arå throwî  away®      Consequently¬  thå leadinç characteró oæ successivå lineó oæ á  multiplå      linå functioî keù definitioî caî bå inadvertintlù removed. How to Fix the Problem: Consider the function key definition: F1 \;Hi There_Rtn\;Soooo Long_Rtn Which should print: A>;Hi There A>;Soooo Long Instead you get: A>;Hi There A>ooo Long OOO? The First Three characters have been removed in the process of printing the 'new-line A>' while the CCP was looking for Start/Stop Scroll characters. The Solution is to put some 'padding' after each carriage return. The pad characters will then be read instead of the actual IMS buffer data. So, the previous example should be re:written with 3 spaces (1 each for _Rtn A >): F1 \;Hi There_Rtn \;Soooo Long_Rtn .pa ŠProblem Area:      Function Key Definition Files Programs Effected:      All '.KEY' files Nature of the Problem:       Manù  oæ  thå  worä  processinç programó  (NW.COÍ  WS.COM©  havå  á      Documenô  Modå  whicè  makeó  uså oæ thå paritù  biô  tï  identifù  sofô      carriagå  returnó anä spaces®  Thå currenô verisioî oæ Key.coí doeó  NOÔ      strið thå paritù biô froí characteró comminç froí thå inpuô (.KEY© file®      Consequently¬  speciaì  identifieró  (likå _Rtî oò F1© whicè  contaiî  á      character with the parity bit set are not recognized. How to Fix the Problem:       Preventioî ió thå besô defense® Alwayó uså thå Non-Documenô Modå oæ      anù editoò wheî creatinç '.KEY§ files® Iæ yoõ suspecô thaô youò filå haó      characteró  witè thå paritù biô seô theî uså pip'ó 'z§ optioî tï  removå      the parity bits. For Example;       A>pip MyKey.Key=MyKey.Key[z]       This command line removes all of the parity bits from the file MyKey. test module else ;Else if2 ; print an error message on pass2 .printx "The dsk2 module has overflowed into the test module" endif endif end þ@Â> ÍC !Í Íp ÃDISK FULLååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååry point, and then saves ; the registers after swapping hl and de. ; GetBuf: ld de,LocBuf ;DE:= Pointer to Local Buffer call DoCold ;Move System Memory into the local buffer ld (saveBC),bc ;Save the returned registers ex de,hl ;HL:= Pointer to first xlt ld (saveDE),de ld (saveHL),hl ret ;Return ;---------------------------------------------------------------------- ; PUTBUF - Put the Local Buffer into System Memory (4_Jan_84) ;------------------------------------------------------------ ; 1) This is the inverse of GetBuf; It replaces the system's memory ; with the contents of the local buffer. ; 2) GetBuf MUST be called before entering this routine. ; PutBuf: ld a,1 ;Function_1:= Write to system memory ld bc,(SaveBC) ld de,(SaveDE) ld hl,(SaveHL) ;Restore the Returned Registers call DoCold ;Write the Mtabs back into system memory ret ;---------------------------------------------------------------------- ; DOCOLD - Call the Bios Cold Boot Entry Point (4_JanExtended Bios Function Calls (28_Feb_84) Copyright 1984 Morrow Designs, Inc. San Leandro, Ca. Function Summary ---------------- Func0 Read from System Memory Func1 Write to system memory Func2 Read ramdaty and Apif Func3 Read system mtabs Func4 Read drvtbl and all DPH Func5 Read dpb_table and all DPB Func6 Read character table Func7 Read virtual drive message Func8 Read free space Func9 Format a Track Func10 Initialize the CTC Func11 Inject Ims Sting into the Free Space Func12 Enable/Disable centronics interrupts Func13 Enable/Disable disk [read after write] / [read before write] Func14 Execute in system bank Func15 Verify track, destructive Func16 Verify track, non-destructive Func17 Modify contents of CFlag with the E register Func18 Read the Rom ID Block .pa ŠFunction Description: Func0 - Read from System Memory ------------------------------- DE -> Destination (in the tpa) HL -> Source (in the system bank) BC -> Number of bytes to move Func1 - Write to system memory ------------------------------ DE -> Destination (in the system bank) HL -> Source (in the tpa) BC -> Number of bytes to move Func2 - Read ramdaty and APIF ----------------------------- DE -> Destination (in the tpa) Func3 - Read system mtabs ------------------------- DE-> Destination (in the tpa) Func4 - Read drvtbl and all DPH ------------------------------- DE -> Destination (in the tpa) Func5 - Read dpb_table and all DPB ---------------------------------- DE -> Destination (in the tpa) Func6 - Read character table ---------------------------- DE -> Destination (in the tpa) Func7 - Read virtual drive message ---------------------------------- DE -> Destination (in the tpa) Func8 - Read Free space ----------------------- DE -> Destination (in the tpa) .pa ŠFunc9 - Format a Track ---------------------- DE -> Pointer to an MTab IX -> Pointer to user APIF Area followed by a sector table with the sectors in reverse order. Func10 - Initialize the CTC --------------------------- ---- No Arguments Func11 - Inject Ims Sting into the Free Space --------------------------------------------- DE -> Pointer to Ims String (first byte of the string is its length). Func12 - Enable/Disable centronics interrupts --------------------------------------------- E -> Switch (0=disable) Func13 - Enable/Disable disk [read after write] / [read before write] --------------------------------------------------------------------- E -> Switch Read after Write - 0=disable, 1=enable Read before Write - 0=disable, 2=enable Func14 - execute in system bank ------------------------------- HL -> Execution Address (in system bank) Func15 - Verify track, destructive ---------------------------------- Func16 - Verify track, non-destructive -------------------------------------- Func17 - Modify contents of CFlag with the E register ----------------------------------------------------- E -> New value of CFlag D -> Old Contents of CFlag Func18 Read the Rom ID Block ----------------------------- DE -> Destination (in the tpa) .pa ŠSample Access Routine (28_Feb_84) A large number of the extended bios routines (0, 2 through 8 and 18) move data structures from the system bank to the tpa bank. Typically, these structures are moved into the tpa for modification and then put back into the system bank. The following three routines can greatly simplify this task. ;---------------------------------------------------------------------- ; GETBUF - Move system memory into the local buffer (4_Jan_84) ;------------------------------------------------------------- ; 1) This routine forces the destination to be the local buffer, calls ; the cold start (extended bios functions) entry point, and then saves ; the registers after swapping hl and de. ; 2) Enter with Accm equal to the extended bios function desired ; GetBuf: ld de,LocBuf ;DE:= Pointer to Local Buffer call DoCold ;Move System Memory into the local buffer ld (saveBC),bc ;Save the returned registers ex de,hl ;HL:= Pointer to first xlt ld (saveDE),de ld (saveHL),hl ret ;Return ;---------------------------------------------------------------------- ; PUTBUF - Put the Local Buffer into System Memory (4_Jan_84) ;------------------------------------------------------------ ; 1) This is the inverse of GetBuf; It replaces the system's memory ; with the contents of