home *** CD-ROM | disk | FTP | other *** search
- Directory Manipulation Routines -- DIRECT, DIR, DIRSEL, DIRALP
- Numeric String Evaluation Routines -- EVAL, EVAL16, EVAL10, EVAL8, EVAL2
- Byte-Oriented File Input/Output Routines
- FI$OPEN and FO$OPEN, et al -- Byte-Oriented Input and Output File Open
- FI$CLOSE and FO$CLOSE, et al -- Byte-Oriented Input and Output File Close
- F$GET and F$PUT, et al -- Byte-Oriented Input and Output
- CP/M File Input/Output Routines
- INITFCB -- Initialize FCB
- File Manipulation -- F$OPEN, F$CLOSE, F$MAKE, F$DELETE
- File Input/Output Routines -- F$READ and F$WRITE
- Input Line Editor -- INLINE
- String Output Routines -- PRINT, LPRINT, PSTR, LPSTR
- Numeriπá Outpu⌠ Routine≤ -- PHL4HC,PHL5DC,PHLDC,PA2HC,PA3DC,PADC¼ L's, M's
- String and Value Comparison Routines -- COMPHD,COMPB,COMPBC,SCANNER,INSTR
- <CR> <LF> Output -- CRLF and LCRLF
- Conditional Input -- CONDIN
- General Input Routines -- CST, CIN, RIN
- General Output Routines -- COUT, LOUT, POUT, CCOUT, CLOUT, CPOUT
- Misπ Routine≤ -- BDOS¼ CAPS¼ CIO¼ EN¼ FILLB¼ FILLBC¼ MOVEB¼ MOVEBC¼ CATH
- :Directory Manipulation Routines -- DIRECT, DIR, DIRSEL, DIRALP
- Routine Name: DIRECT
- Function║á DIREC╘á load≤á ß cop∙ oµ thσ director∙á oµá thσá currentl∙ ì
- logged-iε disδ drivσ int∩ thσ 3▓ ° 6┤ bytσ buffe≥ pointeΣ t∩ b∙ HL¼ select≤ ì
- al∞á filσ entrie≤ whicΦ matcΦ thσ content≤ oµ thσ 11-bytσ filσ namσá buffe≥ ì
- pointeΣá t∩á b∙á D┼ (buffe≥ ma∙ contaiε ?'≤ a≤á wilΣá specifications)¼á anΣ ì
- alphabetize≤ thσ entrie≤ iε thσ buffe≥ eithe≥ b∙ filσ name/typσ o≥ b∙á filσ ì
- type/name«á Onl∙á entrie≤á wherσ thσ exten⌠ i≤ zer∩ (1s⌠ filσá entry⌐á arσ ì
- returned.
- Inputs: HL points to the 32 x 64 byte buffer for the directory
- D┼ point≤ t∩ thσ 11-bytσ filσ name/typσ buffe≥ containinτ thσ ì
- file name/type to select
- ┴á i≤ alphabetizatioε indicator╗á A=░ =╛ alphabetizσ b∙á filσ ì
- name and type, A<>0 => alphabetize by file type and name
- Outputs: A = number of entries in directory buffer
- Registers Affected: PSW
- SYSLIB Routines Called: -None- (All calls within module)
- Special Error Conditions: -None-
-
- Routine Name: DIR
- Function║á DI╥ load≤ ß cop∙ oµ thσ director∙ oµ thσ currentl∙ logged-ì
- iε disδ drivσ int∩ thσ 3▓ ° 6┤ bytσ buffe≥ pointeΣ t∩ b∙ L«á Oε return¼á ┴ ì
- contains a count of the number of entries in the directory.
- Inputs: HL points to the 32 x 64 byte buffer for the directory
- Outputs: A = number of entries in directory buffer
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routiεe ╬ame: DIRSEL (DIRSELECT)
- Function║ DIRSE╠ scan≤ thσ director∙ buffe≥ pointeΣ t∩ b∙ H╠ fo≥á thσ ì
- filσáá name/typσá pointeΣá t∩á b∙á D┼á (ma∙á contaiεá ?'≤á fo≥á wilΣáá carΣ ì
- specifications)«á I⌠ restructure≤ thσ director∙ buffe≥ t∩ contaiε onl∙ thσ ì
- matchinτ entries«á Oε return¼ A=numbe≥ oµ entrie≤ iε buffer« Onl∙ entrie≤ ì
- witΦ extent≤ equa∞ t∩ zer∩ arσ selected╗á al∞ entrie≤ witΦ non-zer∩ extent≤ ì
- are rejected.
- Inputs: HL points to the 32 x 64 byte buffer for the directory
- DE points to the 11-byte file name/type buffer
- A = number of entries in directory buffer
- Outputs: A = number of entries in directory buffer
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: DIRALP (DIRALPHABETIZE)
- Function║á DIRAL╨ alphabetize≤ thσ director∙ buffe≥ pointeΣ t∩ b∙á H╠ ì
- accordinτá t∩ thσ comparσ optioε passeΣ iε ├ (iµ C=0¼á alphabetizσ b∙á filσ ì
- name & type; if C<>0, alphabetize by file type & name).
- Inputs: HL points to the 32 x 64 byte buffer for the directory
- C = alphabetization flag (FN & FT if C=0, FT & FN if C<>0)
- A = number of entries in directory buffer
- Outputs: -None- (buffer is alphabetized)
- Registers Affected: -None-
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
- :Numeric String Evaluation Routines -- EVAL, EVAL16, EVAL10, EVAL8, EVAL2
- Routine Name: EVAL
- Function║ Thi≤ routinσ convert≤ thσ characte≥ strinτ pointeΣ t∩ b∙ H╠ ì
- int∩á thσá 16-bi⌠á binar∙á numbe≥ representeΣ b∙á it«á EVA╠á perform≤á thσ ì
- conversioε unti∞ ß non-hexadecima∞ characte≥ i≤ encountered¼á a⌠ whicΦ timσ ì
- i⌠á look≤ a⌠ thσ las⌠ characte≥ anΣ thσ previou≤ characte≥ t∩ determinσá iµ ì
- thσ strinτ i≤ representinτ ß binary¼ octal¼ decimal¼ o≥ hexadecima∞ number« ì
- Inpu⌠ strinτ character≤ ma∙ bσ upper- o≥ lower-case« ValiΣ format≤ fo≥ thσ ì
- input string are --
- bbbbbbbbbbbbbbbbB -- b=0 or b=1; Binary string
- ttttt or tttttD -- 0 <= t <= 9; Decimal string
- hhhhH or hhhhX -- 0 <= h <= F; Hexadecimal string
- oooooooO or oooooooQ -- 0 <= o <= 7; Octal string
-
-
- Inputs: HL points to the first byte of the string to convert
- String is loaded in a buffer
- Outputs: HL points to next character after converted string
- DE contains 16-bit value
- A = E
- CARR┘á Flaτá Se⌠ mean≤ aε erro≥ wa≤á encountereΣá iεá strinτ ì
- format
- Registers Affected: PSW, DE, HL
- SYSLIB Routines Called: CAPS, EVAL16, EVAL10, EVAL8, EVAL2
- Specia∞á Erro≥ Conditions║ CARR┘ Flaτ Se⌠ indicate≤ tha⌠ aε erro≥ wa≤ ì
- encountereΣá iεá thσ evaluatioε oµ thσ string╗á iµ so¼á H╠á point≤á t∩á thσ ì
- offending character
-
- Routine Name: EVAL16
- Function║á EVAL1╢ convert≤ thσ strinτ oµ ASCI╔ hexadecima∞ character≤ ì
- pointeΣ t∩ b∙ H╠ int∩ ß 16-bi⌠ binar∙ value«á Conversioε progresse≤á unti∞ ì
- an invalid hexadecimal digit (0-9, A-F) is encountered.
- Inputs: HL points to the first byte of the string to convert
- String is loaded in a buffer
- Outputs: HL points to the offending character
- DE contains the 16-bit value
- A = E
- Registers Affected: PSW, DE, HL
- SYSLIB Routines Called: CAPS
- Special Error Conditions: -None-
-
- Routine Name: EVAL10
- Function║á EVAL1░á convert≤á thσ strinτ oµ ASCI╔á decima∞á character≤ ì
- pointeΣ t∩ b∙ H╠ int∩ ß 16-bi⌠ binar∙ value«á Conversioε progresse≤á unti∞ ì
- an invalid decimal digit (0-9) is encountered.
- Inputs: HL points to the first byte of the string to convert
- String is loaded in a buffer
- Outputs: HL points to the offending character
- DE contains the 16-bit value
- A = E
- Registers Affected: PSW, DE, HL
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: EVAL8
- Function║ EVAL╕ convert≤ thσ strinτ oµ ASCI╔ octa∞ character≤ pointeΣ ì
- t∩á b∙á H╠á int∩ ß 16-bi⌠ binar∙ value«á Conversioεá progresse≤á unti∞á aε ì
- invalid octal digit (0-7) is encountered.
- Inputs: HL points to the first byte of the string to convert
- String is loaded in a buffer
- Outputs: HL points to the offending character
- DE contains the 16-bit value
- A = E
- Registers Affected: PSW, DE, HL
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: EVAL2
- Function║á EVAL▓á convert≤á thσá strinτ oµá ASCI╔á binar∙á character≤ ì
- pointeΣ t∩ b∙ H╠ int∩ ß 16-bi⌠ binar∙ value«á Conversioε progresse≤á unti∞ ì
- an invalid binary digit (0-1) is encountered.
- Inputs: HL points to the first byte of the string to convert
- String is loaded in a buffer
- Outputs: HL points to the offending character
- DE contains the 16-bit value
- A = E
- Registers Affected: PSW, DE, HL
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
- :Byte-Oriented File Input/Output Routines
- Thσá followinτá documentatioε cover≤ thσ serie≤ oµ byte-orienteΣá filσ ì
- input/outpu⌠á routine≤á iεá SYSLIB«á Thesσá routine≤á allo≈á thσá use≥á t∩ ì
- sequentiall∙á reaΣ froφ (GET⌐ anΣ writσ t∩ (PUT⌐ ß filσ oε ßá byte-for-bytσ ì
- basis«á Hence¼á thesσ routine≤ providσ aε exceptionall∙ simplσ methoΣá fo≥ ì
- handling input from and output to a file.
- ┴á typica∞ prograφ whicΦ employ≤ thesσ routine≤ mus⌠ opeε thσ requireΣ ì
- file≤ beforσ doinτ an∙ processing¼á mus⌠ theε perforφ thσ processinτ oε thσ ì
- openeΣá files¼á anΣá mus⌠á theεá closσ thσ file≤á wheεá thσá processinτá i≤ ì
- completσá (closinτ thσ file≤ i≤ optiona∞ fo≥ inpu⌠ file≤ anΣ mandator∙á fo≥ ì
- output files).
- SYSLI┬ provide≤ fou≥ set≤ oµ routine≤ fo≥ byte-orienteΣ filσ inpu⌠ anΣ ì
- output. These routines are --
-
- Input Open Output Open GET PUT Input Close Output Close
- ---------- ----------- --- --¡ ----------- ------------
- FI$OPEN FO$OPEN F$GET F$PUT FI$CLOSE FO$CLOSE
- F1I$OPEN F1O$OPEN F1$GET F1$PUT F1I$CLOSE F1O$CLOSE
- F2I$OPEN F2O$OPEN F2$GET F2$PUT F2I$CLOSE F2O$CLOSE
- F3I$OPEN F3O$OPEN F3$GET F3$PUT F3I$CLOSE F3O$CLOSE
-
- Thi≤ systeφ allow≤ thσ use≥ t∩ havσ u≡ t∩ ╕ file≤ opeεá simultaneousl∙ ì
- -- fou≥á arσá opeε fo≥ inpu⌠ usinτ GE╘ anΣ fou≥ arσ opeε fo≥á outpu⌠á usinτ ì
- PUT«á Fo≥á example¼á thσá followinτ i≤ ß samplσ codσ sectioεá usinτá thesσ ì
- routines for two files:
-
-
- EXT FI$OPEN ; DECLARE LIBRARY REFERENCES
- EXT FO$OPEN
- EXT FI$CLOSE
- EXT FO$CLOSE
- EXT F$GET
- EXT F$PUT
- ...
- LXI D,FCBI ; PT TO FCB OF INPUT FILE
- CALL FI$OPEN
- LXI D,FCBO ; PT TO FCB OF OUTPUT FILE
- CALL FO$OPEN
- ...
- [body containing CALL F$GET and CALL F$PUT where required]
- ...
- CALL FI$CLOSE ; CLOSE FILE
- CALL FO$CLOSE
- ...
- END
-
- Notσá tha⌠á onl∙á thσ routine≤ t∩ bσ useΣ arσ referenceΣá iεá thσá EX╘ ì
- statements«á Iµ yo⌡ d∩ no⌠ neeΣ ß particula≥ routine¼ d∩ no⌠ referencσ it« ì
- No⌠á referencinτá aε unneedeΣ routinσ generall∙ save≤ thσá overheaΣá memor∙ ì
- spacσ oµ loadinτ i⌠ froφ thσ library.
- EacΦ se⌠ oµ OPEN¼á CLOSE¼á GET¼á anΣ PU╘ routine≤ i≤ containeΣ iεá onσ ì
- librar∙á module¼á s∩á referencinτ an∙ oµ thesσ routine≤ cause≤á thσá entirσ ì
- modulσá t∩á bσá loaded¼á anΣ al∞ thσ routine≤ arσ accessablσá t∩á thσá use≥ ì
- (provideΣá the∙á arσá mentioneΣá iε thσ extena∞á definitions⌐á withou⌠á an∙ ì
- additiona∞ memor∙á overhead«á Specifically¼á FI$OPEN¼á FI$CLOSE¼á FO$OPEN¼ ì
- FO$CLOSE¼á F$GET¼á anΣ F$PU╘ arσ containeΣ iε onσ module¼á anΣ referencσ t∩ ì
- an∙á oµá thesσ routine≤ load≤ thσ entirσ module╗á thσ samσ i≤ truσ fo≥á thσ ì
- other sets of routines.
- Thσá CLOS┼ routinσ fo≥ outpu⌠ (FO$CLOSE⌐ i≤ ALWAY╙ required╗á i⌠ fill≤ ì
- thσá res⌠á oµ thσ curren⌠ blocδ witΦ Ctrl-┌ followeΣ b∙á <NULL╛á byte≤á anΣ ì
- properl∙á close≤ file«á Thσ CLOS┼ routinσ fo≥ inpu⌠ (FI$CLOSE⌐ i≤ requireΣ ì
- ONL┘á I╞á yo⌡á arσ goinτ t∩ late≥ opeε anothe≥ filσá fo≥á inpu⌠á usinτá thσ ì
- correspondinτá OPE╬ routinσ (FI$OPEN)«á FI$CLOS┼ onl∙ serve≤ t∩ rese⌠á thσ ì
- OPE╬á flaτá (useΣá t∩á GE╘ t∩ ascertaiε tha⌠ thσá filσá ha≤á beeεá properl∙ ì
- opened).
- :FI$OPEN and FO$OPEN, et al -- Byte-Oriented Input and Output File Open
- Routine Names: FI$OPEN, F1I$OPEN, F2I$OPEN, F3I$OPEN
- Function║ Opeε thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ D┼ fo≥ inpu⌠á (usσ ì
- witΦ F$GET).
- Inputs: DE = ptr to FCB of file to open
- Outputs: -None- (File is Opened)
- Registers Affected: PSW
- SYSLIB Routines Called: F$OPEN, PRINT
- Special Error Conditions: Failure to properly open aborts to CP/M.
-
- Routine Names: FO$OPEN, F1O$OPEN, F2O$OPEN, F3O$OPEN
- Function║ Opeε thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ D┼ fo≥ outpu⌠ (usσ ì
- with F$PUT).
- Inputs: DE = ptr to FCB of file to open
- Outputs: -None- (File is Opened)
- Registers Affected: PSW
- SYSLIB Routines Called: F$OPEN, PRINT
- Special Error Conditions: Failure to properly open aborts to CP/M.
- :FI$CLOSE and FO$CLOSE, et al -- Byte-Oriented Input and Output File Close
- Routine Names: FI$CLOSE, F1I$CLOSE, F2I$CLOSE, F3I$CLOSE
- Function║á Closσá thσá filσ previousl∙ openeΣá b∙á thσá correspondinτ ì
- FI$OPE╬á routine«á Usσá oµ thesσ routine≤ i≤ optiona∞ iµ thσ anothe≥á filσ ì
- wil∞á no⌠á bσá openeΣ late≥ iε thσ prograφá b∙á thσá correspondinτá FI$OPE╬ ì
- routine.
- Inputs: -None-
- Outputs: -None- (File is Closed)
- Registers Affected: -None-
- SYSLIB Routines Called: F$OPEN, PRINT
- Specia∞á Erro≥á Conditions║á Iµ ß filσ i≤ no⌠ alread∙ openeΣá b∙á thσ ì
- corresponding FI$OPEN routine, no error results.
-
- Routine Names: FO$CLOSE, F1O$CLOSE, F2O$CLOSE, F3O$CLOSE
- Function║á Closσá thσá filσ previousl∙ openeΣá b∙á thσá correspondinτ ì
- FO$OPE╬á routine«á Usσ oµ thesσ routine≤ i≤ MANDATOR┘ afte≥ outpu⌠ t∩á thσ ì
- file (using the corresponding F$PUT routine) is complete.
- Inputs: -None-
- Outputs: -None- (File is Closed)
- Registers Affected: -None-
- SYSLIB Routines Called: F$OPEN, PRINT
- Specia∞á Erro≥á Conditions║ Iµ ß filσ i≤á no⌠á alread∙á opened¼á thi≤ ì
- routine aborts to CP/M.
- :F$GET and F$PUT, et al -- Byte-Oriented Input and Output
- Routine Names: F$GET, F1$GET, F2$GET, F3$GET
- Function║á Ge⌠á thσá nex⌠ bytσ iε sequencσ froφ thσá filσá previousl∙ ì
- openeΣ b∙ thσ correspondinτ FI$OPE╬ routine«á Bytσ i≤ returneΣ iε Registe≥ ì
- A.
- Inputs: -None-
- Outputs: A = Next byte from file
- Carry Flag is Set (C) if EOF or past EOF read occurs
- Carry Flag is Reset (NC) if read was OK
- Registers Affected: PSW
- SYSLIB Routines Called: F$OPEN, PRINT
- Specia∞á Erro≥ Conditions║ Erro≥ conditioε i≤ returneΣ iε Carr∙ Flag« ì
- Iµá ß filσ wa≤ no⌠ previousl∙ openeΣ b∙ thσ correspondinτ FI$OPE╬á routine¼ ì
- abort≤ t∩ CP/M.
-
- Routine Names: F$PUT, F1$PUT, F2$PUT, F3$PUT
- Function║á Pu⌠á thσá bytσá iε Registe≥ ┴ ont∩ thσá enΣá oµá thσá filσ ì
- previously opened by the corresponding FO$OPEN routine.
- Inputs: A = Byte to PUT
- Outputs: -None-
- Registers Affected: -None-
- SYSLIB Routines Called: F$OPEN, PRINT
- Specia∞á Erro≥ Conditions║ Iµ ß filσ wa≤ no⌠ previousl∙ openeΣ b∙ thσ ì
- correspondinτá FO$OPE╬á routine¼á abort≤ t∩ CP/M«á Iµ aε erro≥á occur≤á iε ì
- writinτ t∩ thσ disk¼ abort≤ t∩ CP/M.
- :CP/M File Input/Output Routines
- Thσá followinτá routine≤ arσ general-purposσ filσ I/╧á routine≤á whicΦ ì
- interfacσ t∩ CP/═ througΦ thσ Entr∙ Poin⌠ a⌠ locatioε 5« The∙ preservσ BC¼ ì
- DE¼á anΣá HL¼á anΣá the∙ returε witΦ thσ standarΣ CP/═ erro≥ code≤ fo≥á thσ ì
- corresponding routines.
- Specifically, these routines are --
-
- INITFCB Initialize FCB from a string of the form "filename.typ"
- F$OPEN Open a file
- F$CLOSE Close a file
- F$MAKE Create a file
- F$DELETE Delete a file
- F$READ Read a block (128 bytes) from a file
- F$WRITE Write a block (128 bytes) to a file
- :INITFCB -- Initialize FCB
- Routine Name: INITFCB
- Function║á Giveε thσ namσ oµ ß filσ (filename.typ⌐ pointeΣ t∩á b∙á H╠ ì
- anΣá ß 33-bytσ buffe≥ pointeΣ t∩ b∙ DE¼á INITFC┬ initialize≤ thi≤ buffe≥ a≤ ì
- aεá FC┬á containinτá thσ filσ namσ anΣ filσ typσ correctl∙á placeΣá iεá thσ ì
- buffe≥á anΣá al∞á othe≥ entrie≤ zero«á Thσ inpu⌠ strinτá consist≤á oµá 1-╕ ì
- character≤ fo≥ thσ filσ name¼á ß decima∞ poin⌠ (optional)¼á 1-│á character≤ ì
- fo≥á thσ filσ typσ (optional)¼á anΣ ß trailinτ characte≥ oµ spacσ (<SP>⌐ o≥ ì
- less« WilΣ card≤ (?,*⌐ ma∙ bσ includeΣ iε thσ string« ┴ samplσ usagσ is:
-
- ...
- LXI H,NAME
- LXI D,FCB ; HL PTS TO FILE NAME, DE PTS TO BUFFER
- CALL INITFCB
- ...
- NAME: DB 'FILE.TYP',0
- FCB: DS 33
- ...
-
-
- Inputs: HL = pointer to file name string "filename.typ<SP>"
- DE = pointer to FCB buffer
- Outputs: A = Error Code
- 0 --> No Error
- 1 --> File name > 8 characters
- 2 --> File type > 3 characters
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
- :File Manipulation -- F$OPEN, F$CLOSE, F$MAKE, F$DELETE
- Routine Name: F$OPEN
- Function║á Opeε thσ filσ specifieΣ b∙ thσ FC┬ pointeΣ t∩ b∙á DE«á Iµ ì
- filσ i≤ no⌠ found¼ F$OPE╬ ask≤ thσ use≥ (oε CON:⌐ iµ hσ wishe≤ t∩ creatσ i⌠ ì
- anΣá doe≤á s∩ iµ thσ answe≥ i≤ 'Yº o≥ 'yº (F$OPE╬ simpl∙á return≤á witΦá aε ì
- appropriate error code if answer is negative).
- Inputs: DE = pointer to FCB
- Outputs: A = Error Code
- 0 --> No Error
- 0FFH --> File not opened or created
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS, CAPS, CIN, COUT, CRLF, PRINT
- Special Error Conditions: -None-
-
- Routine Name: F$CLOSE
- Function: Close the file whose FCB is pointed to by DE.
- Inputs: DE = pointer to FCB
- Outputs: A = Error Code
- 0 --> No Error
- 0FFH --> Error in closing file
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS
- Special Error Conditions: -None-
-
- Routine Name: F$MAKE
- Function: Create (Make) the file whose FCB is pointed to by DE.
- Inputs: DE = pointer to FCB
- Outputs: A = Error Code
- 0FFH --> No directory space available
- Not 0FFH --> No Error; Value is byte address in
- TBUFF (80H-0FFH) of directory entry
- allocated to the FCB
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS, F$DELETE
- Special Error Conditions: -None-
-
- Routine Name: F$DELETE
- Function║á Deletσá thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ DE«á Iµá filσ ì
- does not exist, nothing happens (no error message or code is given).
- Inputs: DE = pointer to FCB
- Outputs: -None-
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS
- Special Error Conditions: -None-
- :File Input/Output Routines -- F$READ and F$WRITE
- Routine Name: F$READ
- Function║ ReaΣ nex⌠ blocδ (12╕ bytes⌐ froφ thσ openeΣ filσ whosσá FC┬ ì
- is pointed to by DE into TBUFF (buffer at 80H - 0FFH).
- Inputs: DE = pointer to FCB
- Outputs: A = Error Code
- 0 --> No Error
- 1 --> Read past end of file
- 2 --> Reading unwritten data in random access
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS
- Special Error Conditions: -None-
-
- Routine Name: F$WRITE
- Function║á Writσá nex⌠ blocδ (12╕ bytes⌐ froφ TBUF╞ (buffe≥ a⌠ 80╚á - ì
- 0FFH) to the opened file whose FCB is pointed to by DE.
- Inputs: DE = pointer to FCB
- Outputs: A = Error Code
- 0 --> No Error
- 1 --> Error in extending file
- 2 --> End of disk data
- 0FFH --> No more directory space
- Registers Affected: PSW
- SYSLIB Routines Called: BDOS
- Special Error Conditions: -None-
- :Input Line Editor -- INLINE
- Routine Name: INLINE
- Function║á INLIN┼ allow≤ thσ use≥ t∩ inpu⌠ ß linσ oµ tex⌠á froφá CON║ ì
- int∩ thσ buffe≥ pointeΣ t∩ b∙ HL«á Thσ use≥ i≤ alloweΣ t∩ edi⌠ thσ tex⌠ a≤ ì
- he types it, and INLINE responds to the following editor commands:
-
- Key Command Function
- ----------- --------
- <BS> Delete previous character and back up cursor
- <DEL> Delete previous character and echo it (like CP/M)
- <CR> Input complete -- return to calling program
- <LF> Skip down to next physical line and insert a <CR> <LF>
- into buffer
- <TAB> Tabulate to next tab stop (every 8, as in CP/M)
- Ctrl-U, Erase current line (clear buffer) and restart input
- Ctrl-X
- Ctrl-R Retype current line
-
- Oε exit¼á thσ buffe≥ contain≤ thσ tex⌠ entereΣ followeΣ b∙ ß <NULL╛ (binar∙ ì
- 0); the <CR> typed to end the input is NOT placed in the buffer.
-
- Inputs: HL = pointer to input line buffer
- Outputs: -None- (Input line buffer contains text typed by user)
- Registers Affected: -None-
- SYSLIB Routines Called: CCOUT, CIN, COUT, CRLF
- Specia∞á Erro≥ Conditions║ <BEL╛ (Bee≡ a⌠ CON:⌐ i≤ outpu⌠ iµá attemp⌠ ì
- i≤ madσ t∩ deletσ characte≥ (<BS╛ o≥ <DEL>⌐ beforσ beginninτ oµá line«á N∩ ì
- limi⌠á o≥á erro≥á checkinτá i≤ donσ oε thσ sizσ oµ thσá inpu⌠á linσá buffe≥ ì
- (buffe≥á overflo≈á i≤ possible¼á s∩ i⌠ i≤ recommendeΣ tha⌠ buffe≥á i≤á madσ ì
- arbitraril∙ large)«á HasΦ marδ (#⌐ i≤ printeΣ iε responsσ t∩ Ctrl-R¼ Ctrl-ì
- U, and Ctrl-X.
- :String Output Routines -- PRINT, LPRINT, PSTR, LPSTR
- Routine Names: PRINT, LPRINT
- Function║á Prin⌠á strinτá pointeΣ t∩ Γ∙ thσ returεá addres≤á oεá CON║
- (PRINT⌐ o≥ LST║ (LPRINT)«á Strinτ i≤ terminateΣ b∙ ß binar∙ 0« Contro∞ i≤
- returned to byte following string.
- Inputs: Return Address = pointer to string to be printed
- Outputs: HL points to byte after string
- (string is printed on CON: or LST:)
- Registers Affected: HL
- SYSLIB Routines Called: PSTR (for PRINT); LSTR (for LPRINT)
- Specia∞á Erro≥ Conditions║ Thσ strinτ MUS╘ bσ terminateΣ b∙ ßá binar∙ ì
- 0!!!
-
- Routine Names: PSTR, LPSTR
- Function║á Prin⌠á strinτá pointeΣ t∩ b∙ H╠ oεá CON║á (PSTR⌐á o≥á LST║ ì
- (LPSTR). String is terminated by a binary 0.
- Inputs: HL = pointer to string to be printed
- Outputs: -None- (string is printed on CON: or LST:)
- Registers Affected: -None-
- SYSLI┬á Routine≤ Called║ CCOUT¼á COU╘ (fo≥ PSTR)╗á LCOUT¼á LOU╘á (fo≥ ì
- LPSTR)
- Specia∞á Erro≥ Conditions║ Thσ strinτ MUS╘ bσ terminateΣ b∙ ßá binar∙ ì
- 0!!!
- :Numeric Output Routines -- PHL4HC,PHL5DC,PHLDC,PA2HC,PA3DC,PADC, L's, M's
- Routine Names: PHL4HC, LHL4HC
- Function║á Prin⌠á H╠á a≤á fou≥ (4⌐á hexadecima∞á character≤á oεá CON║ ì
- (PHL4HC) or LST: (LHL4HC).
- Inputs: HL = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: PA2HC (for PHL4HC); LA2HC (for LHL4HC)
- Special Error Conditions: -None-
-
- Routine Name: MHL4HC
- Function║á Storσ H╠ a≤ fou≥ (4⌐ hexadecima∞ character≤ iε thσá 4-bytσ ì
- memor∙ buffe≥ pointeΣ t∩ b∙ DE« Oε return¼ D┼ point≤ t∩ thσ bytσ followinτ ì
- this buffer.
- Inputs: HL = value to be converted and stored
- DE points to 4-byte buffer
- Outputs: DE points to byte after buffer
- Registers Affected: DE
- SYSLIB Routines Called: MA2HC
- Special Error Conditions: -None-
-
- Routine Names: PHL5DC, LHL5DC
- Function║ Prin⌠ H╠ a≤ fivσ (5⌐ decima∞ character≤ oε CON║ (PHL5DC⌐ o≥ ì
- LST║ (LHL5DC).
- Inputs: HL = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: POUT (for PHL5DC); LOUT (for LHL5DC)
- Special Error Conditions: -None-
-
- Routine Name: MHL5DC
- Function║ Storσ H╠ a⌠ fivσ (5⌐ decima∞ character≤ iε memor∙ iε thσ 5-ì
- bytσ buffe≥ pointeΣ t∩ b∙ DE«á Oε return¼ D┼ point≤ t∩ thσ bytσ afte≥ thi≤ ì
- buffer.
- Inputs: HL = value to be converted and stored
- DE points to a 5-byte buffer
- Outputs: DE points to the byte following the buffer
- Registers Affected: DE
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: PHLDC, LHLDC
- Function║ Prin⌠ H╠ a≤ u≡ t∩ fivσ (5⌐ decima∞ character≤ witΦá leadinτ ì
- spaces (<SP>) on CON: (PHLDC) or LST: (LHLDC).
- Inputs: HL = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: POUT (for PHLDC); LOUT (for LHLDC)
- Special Error Conditions: -None-
-
- Routine Name: MHLDC
- Function║á Storσ H╠ a≤ u≡ t∩ fivσ (5⌐ decima∞ character≤ witΦ leadinτ ì
- spaces in the 5-byte memory buffer pointed to by DE.
- Inputs: HL = value to be converted and printed
- DE points to the 5-byte buffer
- Outputs: DE points to the byte after the buffer
- Registers Affected: DE
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: PA2HC, LA2HC
- Function║á Prin⌠ ┴ a≤ tw∩ (2⌐ hexadecima∞ character≤ oε CON║á (PA2HC⌐ ì
- or LST: (LA2HC).
- Inputs: A = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLI┬á Routine≤ Called║ E╬ (fo≥ both)╗á POU╘ (fo≥ PA2HC)╗á LOU╘ (fo≥ ì
- LA2HC)
- Special Error Conditions: -None-
-
- Routine Name: MA2HC
- Function║á Storσá ┴ a≤ tw∩ (2⌐ hexadecima∞ character≤ iεá thσá 2-bytσ ì
- memory buffer pointed to by HL. On return, HL points to byte after buffer.
- Inputs: A = value to be converted and stored
- HL points to 2-byte buffer
- Outputs: HL points to byte after this buffer
- Registers Affected: HL
- SYSLIB Routines Called: EN
- Special Error Conditions: -None-
-
- Routine Names: PA3DC, LA3DC
- Function║ Prin⌠ ┴ a≤ threσ (3⌐ decima∞ character≤ oε CON║ (PA3DC⌐á o≥ ì
- LST: (LA3DC).
- Inputs: A = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: POUT (for PA3DC); LOUT (for LA3DC)
- Special Error Conditions: -None-
-
- Routine Name: MA3DC
- Function║á Storσá ┴á a≤ threσ (3⌐ decima∞ character≤á iεá thσá 3-bytσ ì
- memor∙ buffe≥ pointeΣ t∩ b∙ HL« Oε return¼ H╠ point≤ t∩ thσ bytσ afte≥ thσ ì
- buffer.
- Inputs: A = value to be converted and stored
- HL points to the 3-byte buffer
- Outputs: HL points to the byte after the buffer
- Registers Affected: HL
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: PADC, LADC
- Function║á Prin⌠ ┴ a≤ u≡ t∩ threσ (3⌐ decima∞ character≤ witΦ leadinτ ì
- spaces (<SP>)áonáCON: (PADC) or LST: (LADC).
- Inputs: A = value to be printed
- Outputs: -None- (Value is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: POUT (for PADC); LOUT (for LADC)
- Special Error Conditions: -None-
-
- Routine Name: MADC
- Function║ Storσ ┴ a≤ u≡ t∩ threσ (3⌐ decima∞ character≤ witΦá leadinτ ì
- space≤ iε thσ 3-bytσ memor∙ buffe≥ pointeΣ t∩ b∙ HL«á Oε return¼ H╠ point≤ ì
- to the byte after the buffer.
- Inputs: A = value to be converted and stored
- HL points to the 3-byte memory buffer
- Outputs: HL points to the byte after the buffer
- Registers Affected: HL
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
- :String and Value Comparision Routines -- COMPHD,COMPB,COMPBC,SCANNER,INSTR
- Routine Name: COMPHD
- Function║ Comparσ H╠ t∩ DE« Oε return¼ Zer∩ Flaτ Se⌠ =╛ HL=DE¼ Carr∙ ì
- Flag Set => HL<DE.
- Inputs: HL, DE -- Values to compare
- Outputs: Zero and Carry Flags
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: COMPB, COMPBC
- Function║ Vecto≥ Comparσ Routines«á Comparσ thσ vecto≥ pointeΣ t∩ b∙ ì
- H╠ witΦ tha⌠ pointeΣ t∩ b∙ D┼ (Vector≤ arσ oµ equa∞ length)« Vector≤ arσ ┬ ì
- byte≤ lonτ fo≥ COMP┬ anΣ B├ byte≤ lonτ fo≥ COMPBC«á Oε exit¼ Zer∩ Flaτ Se⌠ ì
- indicate≤á tha⌠á vector≤ arσ identical╗á Carr∙ Flaτ Se⌠ indicate≤ tha⌠á thσ ì
- vector pointed to by HL is less than the vector pointed to by DE.
- Inputs: HL, DE -- Pointers to vectors to compare
- B (for COMPB), BC (for COMPBC) -- number of bytes in vectors
- Outputs: Zero and Carry Flags
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: SCANNER
- Function║ SCANNE╥ scan≤ thσ vecto≥ oµ byte≤ pointeΣ t∩ b∙ H╠ fo≥á thσ ì
- vecto≥á oµ byte≤ pointeΣ t∩ b∙ DE«á Thσ HL-bytσ vecto≥ i≤ ┬ byte≤ lonτ anΣ ì
- thσ DE-bytσ vecto≥ i≤ ├ byte≤ long«á Oε return¼ iµ found¼ H╠ point≤ t∩ thσ ì
- beginninτ locatioε withiε thσ origina∞ H╠ vecto≥ oµ thσ locateΣ vecto≥á anΣ ì
- thσá Zer∩á Flaτ i≤ Set╗á iµ no⌠ found¼á Zer∩ Flaτ i≤ no⌠ se⌠ anΣ H╠ i≤á no⌠ ì
- affected (points to the beginning of the original HL-byte vector).
- Inputs: HL = Pointer to vector to be scanned
- DE = Pointer to vector to scan for
- B = Number of bytes in HL-vector
- C = Number of bytes in DE-vector
- Outputs: If found, Zero Set and HL pts to located vector
- If not found, Zero Reset and HL unaffected
- Registers Affected: PSW, HL
- SYSLIB Routines Called: -None-
- Specia∞ Erro≥ Conditions║ Automatiπ succes≤ iµ vecto≥ searcheΣ fo≥ i≤ ì
- null.
-
- Routine Name: INSTR
- Function║á INSTRIN╟ Function«á Scaε thσ strinτ pointeΣ t∩ b∙ H╠á fo≥ ì
- thσ strinτ pointeΣ t∩ b∙ DE« ┴ strinτ i≤ ß vecto≥ oµ byte≤ terminateΣ b∙ ß ì
- binary 0.
- Oε return¼á iµ found¼á Zer∩ Flaτ i≤ Se⌠ anΣ H╠ point≤ t∩ 1s⌠ bytσ ì
- oµ substrinτ withiε scanneΣ string╗á iµ no⌠ found¼ Zer∩ Flaτ i≤ no⌠ se⌠ anΣ ì
- HL is not affected.
- Inputs: HL = Pointer to string to be scanned
- DE = Pointer to string to scan for
- Outputs: If found, Zero Set and HL pts to located substring
- If not found, Zero Reset and HL unaffected
- Registers Affected: PSW, HL
- SYSLIB Routines Called: -None-
- Specia∞ Erro≥ Conditions║ Automatiπ succes≤ iµ strinτ searcheΣ fo≥ i≤ ì
- null.
- :<CR> <LF> Output -- CRLF and LCRLF
- Routine Names: CRLF, LCRLF
- Function: Print <CR> and <LF> on CON: (CRLF) or LST: (LCRLF).
- Inputs: -None-
- Outputs: -None- (<CR> <LF> is printed)
- Registers Affected: -None-
- SYSLIB Routines Called: POUT (for CRLF); LOUT (for LCRLF)
- Special Error Conditions: -None-
- :Conditional Input -- CONDIN
- Routine Name: CONDIN
- Function║ Inpu⌠ ß characte≥ froφ CON║ iµ onσ i≤ available╗ otherwise¼ ì
- return a flag stating that a character is not available on CON:.
- Inputs: -None-
- Outputs: A = character typed at CON: (if available)
- Zero Flag is set (Z) if no character is available
- Zero Flag is reset (NZ) if character is available
- Registers Affected: PSW
- SYSLIB Routines Called: CST, CIN
- Special Error Conditions: -None-
- :General Input Routines -- CST, CIN, RIN
- Routine Name: CST
- Function║á Inpu⌠á thσ statu≤ oε CON║ iε Registe≥á A«á Iµá ReaΣá Datß ì
- Available, A=0; otherwise, A=1.
- Inputs: -None-
- Outputs: A = Console Status
- 0 --> Read Data Available (RDA)
- 1 --> Read Data Not Available (Not RDA)
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: CIN, RIN
- Function║ Inpu⌠ characte≥ froφ CON║ (CIN⌐ o≥ RDR║ (RIN⌐ iε Registe≥ A.
- Inputs: -None-
- Outputs: A = Character input from CON: or RDR:
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
- :General Output Routines -- COUT, LOUT, POUT, CCOUT, CLOUT, CPOUT
- Routine Names: COUT, LOUT, POUT
- Function║ Outpu⌠ characte≥ iε Registe≥ ┴ t∩ CON║ (COUT)¼ LST║ (LOUT)¼ ì
- or PUN: (POUT).
- Inputs: A = Character to output
- Outputs: -None- (Character is output)
- Registers Affected: -None-
- SYSLIB Routine Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: CCOUT, CLOUT, CPOUT
- Function║ Outpu⌠ characte≥ iε Registe≥ ┴ t∩ CON║ (COUT)¼ LST║ (LOUT)¼ ì
- o≥á PUN║á (POUT⌐ witΦ contro∞ characte≥ processing«á Al∞á character≤á witΦ ì
- ASCI╔á code≤á les≤ thaε <SP╛ (spacσ ╜ 20H⌐ iε valuσ excep⌠á <NULL>¼á <BEL>¼ ì
- <BS>¼á <LF>¼á anΣá <CR╛á arσá outpu⌠á a≤ aε uparro≈á (^⌐á followeΣá b∙á thσ ì
- correspondinτ lette≥ generateΣ b∙ addinτ 40╚ t∩ thσ characte≥ valuσá (i.e.¼ ì
- ▒ output≤ a≤ "^A"¼á ▓ a≤ "^B"¼ etc.)« Again¼ thσ character≤ les≤ thaε <SP╛ ì
- in value NOT output in this manner are --
-
- <NULL> <BEL> <BS> <LF> <CR>
-
- Any character of value greater than <SP> is output normally.
- Inputs: A = Character to output
- Outputs: -None- (Character/Code is output)
- Registers Affected: PSW (only the Flags; Register A is NOT affected)
- SYSLI┬ Routine≤ Called║ COU╘ (fo≥ CCOUT)╗ LOU╘ (fo≥ CLOUT)╗ POU╘ (fo≥ ì
- CPOUT)
- Special Error Conditions: -None-
- :Miscellaneou≤ Routine≤ -- BDOS¼á CAPS¼á CIO¼á EN¼á FILLB¼á FILLBC¼á MOVEB¼ ì
- MOVEBC, CATH
- Routine Name: BDOS
- Function║á Cal∞ CP/═ Entr∙ Poin⌠ a⌠ locatioε ╡ anΣ preservσ Register≤ ì
- HL and DE.
- Inputs: -As Required by User-
- Outputs: PSW, BC
- Registers Affected: PSW, BC
- SYSLIB Routines Called: -None-
- Special Error Conditions: -Determined by Routines Called-
-
- Routine Name: CAPS
- Function║á Capitalizσ ASCI╔ characte≥ iε Registe≥ ┴ iµ i⌠á i≤á lower-ì
- case alphabetic (a-z); otherwise, return A unaffected.
- Inputs: A = character to capitalize
- Outputs: A = capitalized character
- Registers Affected: PSW
- SYSLIB Routins Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: CIO
- Function║á CP/═á I/╧ througΦ BIO╙ Jum≡ Table«á Thi≤ routinσá indexe≤ ì
- int∩ thσ CP/═ BIO╙ Jum≡ Tablσ anΣ allow≤ thσ use≥ t∩ addres≤ an∙ routinσ iε ì
- thσá BIO╙á (accessablσá routine≤á only)«á I⌠ i≤á calleΣá witΦá Registe≥á ┴ ì
- containinτá thσ inde° offse⌠ (seσ tablσ below⌐ anΣ Register≤ B├á containinτ ì
- an∙ requireΣ inpu⌠ arguments« Thσ followinτ tablσ summarize≤ thσ BIO╙ Jum≡ ì
- Table entries --
-
- Offset Function Offset Function
- 0 Warm Start 7 Home Disk Head
- 1 Console Status; A=0FFH if 8 Select Disk; C=Disk Number (A=0,
- char ready, A=0 if not B=1, C=2, D=3) passed
- 2 Console Input; A=result 9 Set Track Number; C=Track Number
- 3 Console Output; C=char passed passed
- 4 List Output; C=char passed 10 Set Sector Number; C=Sector
- 5 Punch Output; C=char passed Number passed
- 6 Reader Input; A=result 11 Set DMA Address; BC=adr passed
- 12 Read Disk; A=0 if ok, 1 if err
- 13 Write Disk; A=0 if ok, 1 if err
- Any other offset results in a Cold Start being performed.
-
- Inputs: A = Offset
- BC = Data Passed to Routine
- Outputs: A = Output or Error Indicator
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: EN
- Function║á Exchangσ Nybble≤ iε Register A╗á High-orde≥ fou≥ bit≤á arσ ì
- exchanged with Low-order four bits of Register A.
- Inputs: A = Byte input
- Outputs: A = Byte output
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: FILLB, FILLBC
- Function║á Thesσ routine≤ fil∞ aε areß oµ memor∙ witΦ ß constan⌠ bytσ ì
- value« FILL┬ caε fil∞ u≡ t∩ ß 256-bytσ buffer¼ anΣ FILLB├ caε fil∞ u≡ t∩ ß ì
- 65,536-byte (within reason) buffer.
- Inputs: HL points to the first byte of the buffer to be filled
- B (for FILLB) or BC (for FILLBC) = number of bytes in buffer
- A = byte value to fill buffer with
- Outputs: -None- (Buffer is filled)
- Registers Affected: -None-
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Names: MOVEB, MOVEBC
- Function║á Movσá thσ blocδ oµ memor∙ pointeΣ t∩ b∙ H╠ t∩á thσá memor∙ ì
- locatioεá pointeΣ t∩ b∙ DE«á MOVE┬ caε movσ u≡ t∩ ß 256-bytσá buffer¼á anΣ ì
- MOVEBC can move up to a 65,536-byte buffer.
- Inputs: HL points to the first byte of the buffer to move
- DE points to the first byte of the buffer to move to
- B (for MOVEB) or BC (for MOVEBC) = number of bytes in buffer
- Outputs: -None- (Buffer is moved)
- Registers Affected: -None-
- SYSLIB Routines Called: -None-
- Special Error Conditions: -None-
-
- Routine Name: CATH
- Function║á Conver⌠ thσ ASCI╔ Hexadecima∞ characte≥ iε thσ ┴á Registe≥ ì
- t∩ binar∙ iε thσ ┴ Register«á Iµ invaliΣ characte≥ (no⌠ 0-9¼á A-F)¼ returε
- <SP> (20 Hex) in A Register as error code.
- Input: A = ASCII Hex Character (0-9, A-F)
- Output: A = Binary value represented by char
- Registers Affected: PSW
- SYSLIB Routines Called: -None-
- Specia∞ Erro≥ Conditions║ Iµ invaliΣ he° char¼ <SP╛ (2░ Hex⌐ returneΣ ì
- in A Register.