home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol098 / syslibc.hlp < prev    next >
Encoding:
Text File  |  1985-02-10  |  9.1 KB  |  254 lines

  1. Miscellaneous Routines -- Introduction
  2. BDOS and BIOS Routines
  3. Capitalization Routines
  4. Convert ASCII to Hexadecimal
  5. End of Code
  6. Exchange Nybbles
  7. Memory Fill Routines
  8. Memory Move Routines
  9. Delay Routine
  10. Version Number of SYSLIB
  11. :Miscellaneou≤ Routine≤ -- Introduction
  12.  
  13.      Thi≤á sectioεá oµá thσá Hel≡ Filσá describe≤á thσá followinτ ì
  14. Miscellaneous Routines --
  15.           BDOS      For Direct BDOS Interface
  16.           BIOS      For Direct BIOS Interface
  17.           CAPS      For Character Capitalization
  18.           CAPSTR    For String Capitalization
  19.           CATH      Convert ASCII Character to Hexadecimal
  20.           CLINE     Command Line Extraction
  21.           CODEND    Provide End of Code/Data Area
  22.           EN        Exchange Nybbles in A
  23.           FILLB     Fill Memory (up to 255 bytes)
  24.            FILLBC   Fill Memory (up to 65,535 bytes)
  25.            HFILB    Fill Memory (up to 255 bytes)
  26.            HFILBC   Fill Memory (up to 65,535 bytes)
  27.           MOVEB     Move Memory (up to 255 bytes)
  28.            MOVEBC   Move Memory (up to 65,535 bytes)
  29.            HMOVB    Move Memory (up to 255 bytes)
  30.            HMOVBC   Move Memory (up to 65,535 bytes)
  31.           PAUSE     Delay N 10th of a Second
  32.           VERSION   Return Version Number of SYSLIB
  33. :BDOS and BIOS Routines
  34.  
  35.      Routine Name:  BDOS
  36.      Function║
  37.           Cal∞á CP/═á Entr∙á Poin⌠á a⌠ locatioεá ╡á anΣá preservσ ì
  38. Register≤ DE anΣ BC.
  39.      Inputs:  C and DE provide input parameters
  40.      Outputs:  A and HL provide output parameters
  41.      Registers Affected:  PSW, HL
  42.      SYSLIB Routines Called:  -None-
  43.      Special Error Conditions:  -Determined by Routines Called-
  44.      Routine Name:  BIOS
  45.      Function║
  46.           BIO╙ provide≤ thσ use≥ witΦ ß direc⌠ interfacσ int∩ thσ ì
  47. CP/═á BIOS«á  I⌠á i≤ calleΣ witΦ thσ ┴ Reτ containinτá thσá inde° ì
  48. offse⌠á int∩ thσ BIO╙ JM╨ table«á  N∩ register≤ arσ preserveΣá b∙ ì
  49. thi≤ routine«á  Thσ content≤ oµ HL¼á DE¼ anΣ B├ arσ passeΣ t∩ thσ ì
  50. BIOS unchanged.
  51.  
  52.      The following table summarizes the BIOS JMP Table Entries --
  53.  
  54.    Offset Function
  55.       0   Cold Start
  56.       1   Warm Start
  57.       2   Console Status; Returns A=0FFH if char ready, A=0 if
  58.                not
  59.       3   Console Input; Returns char in A
  60.       4   Console Output; Char passed in C
  61.       5   List Output; Char passed in C
  62.       6   Punch Output; Char passed in C
  63.       7   Reader Input; Returns char in A
  64.  
  65. BIOS, Con't
  66.    Offset Function 
  67.       8   Home Disk Head (Return Version Number); Returns
  68.                Version Number in HL
  69.       9   Select Disk; Disk Number (A=0, etc) passed in C
  70.      10   Set Track Number; Track Number passed in C
  71.      11   Set Sector Number; Sector Number passed in C
  72.      12   Set DMA Address; DMA Address passed in BC
  73.      13   Read Block from Disk; Returns A=0 if OK, A=1 if Error
  74.      14   Write Block to Disk; Returns A=0 if OK, A=1 if Error
  75.  
  76.      15   List Status; Returns A=0FFH if ready to output, A=0
  77.                if not
  78.      16   Sector Translation; Logical-to-Physical Sector
  79.                Translation; Logical Sector Number passed in BC
  80.                and Translate Table Address passed in DE; Returns
  81.                Physical Sector Number in HL
  82.  
  83.  
  84. BIOS, Con't
  85.      Inputs:  A = Offset (as per Table Above)
  86.               BC = Input Parameters
  87.      Outputs:  A, HL = Output Parameters
  88.      Registers Affected:  All
  89.      SYSLIB Routines Called:  -None-
  90.      Special Error Conditions:  -None-
  91.  
  92. :Capitalization Routines
  93.  
  94.      Routine Name:  CAPS
  95.      Function║
  96.           Capitalizσá ASCI╔á characte≥á iε Registe≥ ┴á iµá i⌠á i≤ ì
  97. lower-casσá alphabetiπá (a-z)╗á otherwise¼á returε ┴á unaffected«  ì
  98. Onl∙á thσ lowe≥ seveε bit≤ oµ thσ bytσ arσá considered¼á anΣá thσ ì
  99. Mos⌠ Significan⌠ Bi⌠ i≤ maskeΣ ou⌠ t∩ zero.
  100.      Inputs:  A = character to capitalize
  101.      Outputs:  A = capitalized character
  102.      Registers Affected:  PSW
  103.      SYSLIB Routins Called:  -None-
  104.      Special Error Conditions:  -None-
  105.  
  106.  
  107.      Routine Name:  CAPSTR
  108.      Function:
  109.           CAPST╥ capitalize≤ thσ <NULL>-terminateΣ strinτ pointeΣ ì
  110. to by HL.  No Registers are affected.
  111.      Inputs:  HL pts to first byte of string
  112.      Outputs:  None (String is Capitalized)
  113.      Registers Affected:  None
  114.      SYSLIB Routines Called:  CAPS
  115.      Special Error Conditions:  None
  116.  
  117. :Convert ASCII to Hexadecimal
  118.  
  119.      Routine Name:  CATH
  120.      Function║
  121.           Conver⌠á thσá ASCI╔á Hexadecima∞á characte≥á iεá thσá ┴ ì
  122. Registe≥ t∩ binar∙ iε thσ ┴ Register«á  Iµ invaliΣ characte≥ (no⌠ ì
  123. 0-9¼ A-F)¼ returε <SP╛ (2░ Hex⌐ iε ┴ Registe≥ a≤ erro≥ code.
  124.      Input:  A = ASCII Hex Character (0-9, A-F)
  125.      Output:  A = Binary value represented by char
  126.      Registers Affected:  PSW
  127.      SYSLIB Routines Called:  -None-
  128.      Specia∞ Erro≥ Conditions:
  129.           Iµá invaliΣá he°á char¼á <SP╛ (2░ Hex⌐á returneΣá iεá ┴ ì
  130. Register.
  131.  
  132. :Command Line Extraction
  133.  
  134.      Routine Name:  CLINE
  135.      Function:
  136.           Savσá thσ commanΣ linσ whosσ characte≥ coun⌠ i≤ pointeΣ ì
  137. t∩ b∙ H╠ awa∙ iε aε interna∞ buffe≥ a≤ ß string«  Thσ linσ ma∙ bσ ì
  138. u≡ t∩ 25╡ character≤ lonτ anΣ wil∞ bσ truncateΣ iµ i⌠ i≤á longer«  ì
  139. Thσá strinτá wil∞á bσ terminateΣ b∙ ß <NULL╛ a≤á pe≥á thσá SYSLI┬ ì
  140. concept of strings.
  141.      Input:  HL = Address of Command Line Buffer (Char Count)
  142.      Output: HL = Address of Command Line String (1st Char)
  143.              A = 0 and Zero Flag Set (Z) if Buffer Truncated
  144.              A <> 0 and Zero Flag Clear (NZ) if Buffer OK
  145.      Registers Affected:  HL
  146.      SYSLIB Routines Called:  -None-
  147.      Special Error Conditions:  None
  148.  
  149. :End of Code
  150.  
  151.      Routine Name:  CODEND
  152.      Function║
  153.           Returεá thσ addres≤ oµ thσ nex⌠ pagσ followinτ thσ las⌠ ì
  154. bytσá oµ code«á  Thi≤ i≤ usefu∞ iε determininτ wherσ thσá scratcΦ ì
  155. areß begins.
  156.      Inputs:  None
  157.      Output:  HL=Address of next page
  158.      Registers Affected:  HL
  159.      SYSLIB Routines Called:  -None-
  160.      Special Error Conditions:  -None-
  161. è
  162. :Exchange Nybbles
  163.  
  164.      Routine Name:  EN
  165.      Function║
  166.           Exchangσá Nybble≤ iε Registe≥ A╗á High-orde≥ fou≥á bit≤ ì
  167. arσ exchangeΣ witΦ Low-orde≥ fou≥ bit≤ oµ Registe≥ A.
  168.      Inputs:  A = Byte input
  169.      Outputs:  A = Byte output
  170.      Registers Affected:  PSW
  171.      SYSLIB Routines Called:  -None-
  172.      Special Error Conditions:  -None-
  173.  
  174. :Memory Fill Routines
  175.  
  176.      Routine Names:  FILLB, FILLBC, HFILB, HFILBC
  177.      Function║
  178.           Thesσá routine≤ fil∞ aε areß oµ memor∙ witΦ ßá constan⌠ ì
  179. bytσ value«á  FILL┬ caε fil∞ u≡ t∩ ß 256-bytσ buffer¼á anΣ FILLB├ ì
  180. caε fil∞ u≡ t∩ ß 65,536-bytσ (withiε reason⌐ buffer.
  181.      FILL┬á anΣ FILLB├ havσ n∩ effect≤ oε an∙á registers«á  HFIL┬ ì
  182. anΣ HFILB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  183. H╠á pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ filled«á  HFIL┬á anΣ ì
  184. HFILB├á arσá usefu∞ wheε furthe≥ processinτ froφ thσá las⌠á poin⌠ ì
  185. filled is desired.
  186.  
  187.      Inputs:  HL points to the first byte of the buffer to be filled
  188.               B (for FILLB) or BC (for FILLBC) = number of bytes in buffer
  189.               A = byte value to fill buffer with
  190.  
  191.  
  192.      Outputs:  None for FILLB and FILLBC (Buffer is filled)
  193.                H╠ point≤ t∩ nex⌠ bytσ fo≥ HFIL┬ anΣ HFILBC
  194.  
  195.      Registers Affected:  None for FILLB, FILLBC; HL for HFILB,
  196.                               HFILBC
  197.  
  198.      SYSLIB Routines Called:  -None-
  199.  
  200.      Special Error Conditions:  -None-
  201.  
  202. :Memory Move Routines
  203.  
  204.      Routine Names:  MOVEB, MOVEBC, HMOVB, HMOVBC
  205.      Function║
  206.           Movσ thσ blocδ oµ memor∙ pointeΣ t∩ b∙ H╠ t∩ thσ memor∙ ì
  207. locatioεá pointeΣá t∩ b∙ DE«á  MOVE┬ caε movσ u≡á t∩á ßá 256-bytσ ì
  208. buffer¼ anΣ MOVEB├ caε movσ u≡ t∩ ß 65,536-bytσ buffer.
  209.      MOVE┬á anΣ MOVEB├ havσ n∩ effect≤ oε an∙á registers«á  HMOV┬ ì
  210. anΣ HMOVB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  211. H╠ anΣ D┼ pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ moved«á  HMOV┬ ì
  212. anΣ HMOVB├ arσ usefu∞ wheε furthe≥ processinτ froφ thσ las⌠ poin⌠ ì
  213. filleΣ i≤ desired.
  214.  
  215.      Inputs:  HL points to the first byte of the buffer to move
  216.               DE points to the first byte of the buffer to move to
  217.               B (for MOVEB) or BC (for MOVEBC) = number of bytes in buffer
  218.  
  219.  
  220.      Outputs:  None for MOVEB and MOVEBC (Buffer is moved)
  221.                HL and DE pt to byte after last byte moved for
  222.                     HMOVB and HMOVBC
  223.  
  224.      Registers Affected:  None for MOVEB, MOVBC; HL, DE for
  225.                               HMOVB, HMOVBC
  226.  
  227.      SYSLIB Routines Called:  -None-
  228.  
  229.      Special Error Conditions:  -None-
  230.  
  231. :Delay Routine
  232.  
  233.      Routine Name:  PAUSE
  234.      Function:
  235.           Delay N 10ths of a Second.
  236.      Inputs:  HL = N (Number of 10ths of a Second Delay desired)
  237.               B = Processor Speed in MHz (1, 2, 3, 4, ...)
  238.      Outputs:  None (Routine returns N 10ths of a Second later)
  239.      Registers Affected:  None
  240.      SYSLIB Routines Called:  None
  241.      Special Error Conditons:  None
  242.  
  243.  
  244. :Version Number of SYSLIB
  245.  
  246.      Routine Name:  VERSION
  247.      Function:
  248.           Return Version Number of SYSLIB.
  249.      Inputs:  None
  250.      Outputs║  HL=Versioε (H=Major¼ L=Minor╗ H=2¼ L=▒ fo≥ 2.1)
  251.      Registers Affected:  HL
  252.      SYSLIB Routines Called:  None
  253.      Special Error Conditions:  None
  254.  
  255.