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