home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols000
/
vol098
/
syslibc.hlp
< prev
next >
Wrap
Text File
|
1985-02-09
|
9KB
|
254 lines
Miscellaneous Routines -- Introduction
BDOS and BIOS Routines
Capitalization Routines
Convert ASCII to Hexadecimal
End of Code
Exchange Nybbles
Memory Fill Routines
Memory Move Routines
Delay Routine
Version Number of SYSLIB
:Miscellaneou≤ Routine≤ -- Introduction
Thi≤á sectioεá oµá thσá Hel≡ Filσá describe≤á thσá followinτ ì
Miscellaneous Routines --
BDOS For Direct BDOS Interface
BIOS For Direct BIOS Interface
CAPS For Character Capitalization
CAPSTR For String Capitalization
CATH Convert ASCII Character to Hexadecimal
CLINE Command Line Extraction
CODEND Provide End of Code/Data Area
EN Exchange Nybbles in A
FILLB Fill Memory (up to 255 bytes)
FILLBC Fill Memory (up to 65,535 bytes)
HFILB Fill Memory (up to 255 bytes)
HFILBC Fill Memory (up to 65,535 bytes)
MOVEB Move Memory (up to 255 bytes)
MOVEBC Move Memory (up to 65,535 bytes)
HMOVB Move Memory (up to 255 bytes)
HMOVBC Move Memory (up to 65,535 bytes)
PAUSE Delay N 10th of a Second
VERSION Return Version Number of SYSLIB
:BDOS and BIOS Routines
Routine Name: BDOS
Function║
Cal∞á CP/═á Entr∙á Poin⌠á a⌠ locatioεá ╡á anΣá preservσ ì
Register≤ DE anΣ BC.
Inputs: C and DE provide input parameters
Outputs: A and HL provide output parameters
Registers Affected: PSW, HL
SYSLIB Routines Called: -None-
Special Error Conditions: -Determined by Routines Called-
Routine Name: BIOS
Function║
BIO╙ provide≤ thσ use≥ witΦ ß direc⌠ interfacσ int∩ thσ ì
CP/═á BIOS«á I⌠á i≤ calleΣ witΦ thσ ┴ Reτ containinτá thσá inde° ì
offse⌠á int∩ thσ BIO╙ JM╨ table«á N∩ register≤ arσ preserveΣá b∙ ì
thi≤ routine«á Thσ content≤ oµ HL¼á DE¼ anΣ B├ arσ passeΣ t∩ thσ ì
BIOS unchanged.
The following table summarizes the BIOS JMP Table Entries --
Offset Function
0 Cold Start
1 Warm Start
2 Console Status; Returns A=0FFH if char ready, A=0 if
not
3 Console Input; Returns char in A
4 Console Output; Char passed in C
5 List Output; Char passed in C
6 Punch Output; Char passed in C
7 Reader Input; Returns char in A
BIOS, Con't
Offset Function
8 Home Disk Head (Return Version Number); Returns
Version Number in HL
9 Select Disk; Disk Number (A=0, etc) passed in C
10 Set Track Number; Track Number passed in C
11 Set Sector Number; Sector Number passed in C
12 Set DMA Address; DMA Address passed in BC
13 Read Block from Disk; Returns A=0 if OK, A=1 if Error
14 Write Block to Disk; Returns A=0 if OK, A=1 if Error
15 List Status; Returns A=0FFH if ready to output, A=0
if not
16 Sector Translation; Logical-to-Physical Sector
Translation; Logical Sector Number passed in BC
and Translate Table Address passed in DE; Returns
Physical Sector Number in HL
BIOS, Con't
Inputs: A = Offset (as per Table Above)
BC = Input Parameters
Outputs: A, HL = Output Parameters
Registers Affected: All
SYSLIB Routines Called: -None-
Special Error Conditions: -None-
:Capitalization Routines
Routine Name: CAPS
Function║
Capitalizσá ASCI╔á characte≥á iε Registe≥ ┴á iµá i⌠á i≤ ì
lower-casσá alphabetiπá (a-z)╗á otherwise¼á returε ┴á unaffected« ì
Onl∙á thσ lowe≥ seveε bit≤ oµ thσ bytσ arσá considered¼á anΣá thσ ì
Mos⌠ Significan⌠ Bi⌠ i≤ maskeΣ ou⌠ t∩ zero.
Inputs: A = character to capitalize
Outputs: A = capitalized character
Registers Affected: PSW
SYSLIB Routins Called: -None-
Special Error Conditions: -None-
Routine Name: CAPSTR
Function:
CAPST╥ capitalize≤ thσ <NULL>-terminateΣ strinτ pointeΣ ì
to by HL. No Registers are affected.
Inputs: HL pts to first byte of string
Outputs: None (String is Capitalized)
Registers Affected: None
SYSLIB Routines Called: CAPS
Special Error Conditions: None
:Convert ASCII to Hexadecimal
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╛ (2░ Hex⌐ iε ┴ Registe≥ a≤ erro≥ 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Σá iεá ┴ ì
Register.
:Command Line Extraction
Routine Name: CLINE
Function:
Savσá thσ commanΣ linσ whosσ characte≥ coun⌠ i≤ pointeΣ ì
t∩ b∙ H╠ awa∙ iε aε interna∞ buffe≥ a≤ ß string« Thσ linσ ma∙ bσ ì
u≡ t∩ 25╡ character≤ lonτ anΣ wil∞ bσ truncateΣ iµ i⌠ i≤á longer« ì
Thσá strinτá wil∞á bσ terminateΣ b∙ ß <NULL╛ a≤á pe≥á thσá SYSLI┬ ì
concept of strings.
Input: HL = Address of Command Line Buffer (Char Count)
Output: HL = Address of Command Line String (1st Char)
A = 0 and Zero Flag Set (Z) if Buffer Truncated
A <> 0 and Zero Flag Clear (NZ) if Buffer OK
Registers Affected: HL
SYSLIB Routines Called: -None-
Special Error Conditions: None
:End of Code
Routine Name: CODEND
Function║
Returεá thσ addres≤ oµ thσ nex⌠ pagσ followinτ thσ las⌠ ì
bytσá oµ code«á Thi≤ i≤ usefu∞ iε determininτ wherσ thσá scratcΦ ì
areß begins.
Inputs: None
Output: HL=Address of next page
Registers Affected: HL
SYSLIB Routines Called: -None-
Special Error Conditions: -None-è
:Exchange Nybbles
Routine Name: EN
Function║
Exchangσá Nybble≤ iε Registe≥ A╗á High-orde≥ fou≥á bit≤ ì
arσ exchangeΣ witΦ Low-orde≥ fou≥ bit≤ oµ Registe≥ A.
Inputs: A = Byte input
Outputs: A = Byte output
Registers Affected: PSW
SYSLIB Routines Called: -None-
Special Error Conditions: -None-
:Memory Fill Routines
Routine Names: FILLB, FILLBC, HFILB, HFILBC
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-bytσ (withiε reason⌐ buffer.
FILL┬á anΣ FILLB├ havσ n∩ effect≤ oε an∙á registers«á HFIL┬ ì
anΣ HFILB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
H╠á pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ filled«á HFIL┬á anΣ ì
HFILB├á arσá usefu∞ wheε furthe≥ processinτ froφ thσá las⌠á poin⌠ ì
filled is desired.
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 for FILLB and FILLBC (Buffer is filled)
H╠ point≤ t∩ nex⌠ bytσ fo≥ HFIL┬ anΣ HFILBC
Registers Affected: None for FILLB, FILLBC; HL for HFILB,
HFILBC
SYSLIB Routines Called: -None-
Special Error Conditions: -None-
:Memory Move Routines
Routine Names: MOVEB, MOVEBC, HMOVB, HMOVBC
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Σ MOVEB├ caε movσ u≡ t∩ ß 65,536-bytσ buffer.
MOVE┬á anΣ MOVEB├ havσ n∩ effect≤ oε an∙á registers«á HMOV┬ ì
anΣ HMOVB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
H╠ anΣ D┼ pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ moved«á HMOV┬ ì
anΣ HMOVB├ arσ usefu∞ wheε furthe≥ processinτ froφ thσ las⌠ poin⌠ ì
filleΣ i≤ desired.
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 for MOVEB and MOVEBC (Buffer is moved)
HL and DE pt to byte after last byte moved for
HMOVB and HMOVBC
Registers Affected: None for MOVEB, MOVBC; HL, DE for
HMOVB, HMOVBC
SYSLIB Routines Called: -None-
Special Error Conditions: -None-
:Delay Routine
Routine Name: PAUSE
Function:
Delay N 10ths of a Second.
Inputs: HL = N (Number of 10ths of a Second Delay desired)
B = Processor Speed in MHz (1, 2, 3, 4, ...)
Outputs: None (Routine returns N 10ths of a Second later)
Registers Affected: None
SYSLIB Routines Called: None
Special Error Conditons: None
:Version Number of SYSLIB
Routine Name: VERSION
Function:
Return Version Number of SYSLIB.
Inputs: None
Outputs║ HL=Versioε (H=Major¼ L=Minor╗ H=2¼ L=▒ fo≥ 2.1)
Registers Affected: HL
SYSLIB Routines Called: None
Special Error Conditions: None