home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol098 / syslibc.hlp < prev    next >
Text File  |  1985-02-09  |  9KB  |  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. :Exchange Nybbles
  162.  
  163.      Routine Name:  EN
  164.      Function║
  165.           Exchangσá Nybble≤ iε Registe≥ A╗á High-orde≥ fou≥á bit≤ ì
  166. arσ exchangeΣ witΦ Low-orde≥ fou≥ bit≤ oµ Registe≥ A.
  167.      Inputs:  A = Byte input
  168.      Outputs:  A = Byte output
  169.      Registers Affected:  PSW
  170.      SYSLIB Routines Called:  -None-
  171.      Special Error Conditions:  -None-
  172.  
  173. :Memory Fill Routines
  174.  
  175.      Routine Names:  FILLB, FILLBC, HFILB, HFILBC
  176.      Function║
  177.           Thesσá routine≤ fil∞ aε areß oµ memor∙ witΦ ßá constan⌠ ì
  178. bytσ value«á  FILL┬ caε fil∞ u≡ t∩ ß 256-bytσ buffer¼á anΣ FILLB├ ì
  179. caε fil∞ u≡ t∩ ß 65,536-bytσ (withiε reason⌐ buffer.
  180.      FILL┬á anΣ FILLB├ havσ n∩ effect≤ oε an∙á registers«á  HFIL┬ ì
  181. anΣ HFILB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  182. H╠á pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ filled«á  HFIL┬á anΣ ì
  183. HFILB├á arσá usefu∞ wheε furthe≥ processinτ froφ thσá las⌠á poin⌠ ì
  184. filled is desired.
  185.  
  186.      Inputs:  HL points to the first byte of the buffer to be filled
  187.               B (for FILLB) or BC (for FILLBC) = number of bytes in buffer
  188.               A = byte value to fill buffer with
  189.  
  190.  
  191.      Outputs:  None for FILLB and FILLBC (Buffer is filled)
  192.                H╠ point≤ t∩ nex⌠ bytσ fo≥ HFIL┬ anΣ HFILBC
  193.  
  194.      Registers Affected:  None for FILLB, FILLBC; HL for HFILB,
  195.                               HFILBC
  196.  
  197.      SYSLIB Routines Called:  -None-
  198.  
  199.      Special Error Conditions:  -None-
  200.  
  201. :Memory Move Routines
  202.  
  203.      Routine Names:  MOVEB, MOVEBC, HMOVB, HMOVBC
  204.      Function║
  205.           Movσ thσ blocδ oµ memor∙ pointeΣ t∩ b∙ H╠ t∩ thσ memor∙ ì
  206. locatioεá pointeΣá t∩ b∙ DE«á  MOVE┬ caε movσ u≡á t∩á ßá 256-bytσ ì
  207. buffer¼ anΣ MOVEB├ caε movσ u≡ t∩ ß 65,536-bytσ buffer.
  208.      MOVE┬á anΣ MOVEB├ havσ n∩ effect≤ oε an∙á registers«á  HMOV┬ ì
  209. anΣ HMOVB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  210. H╠ anΣ D┼ pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ moved«á  HMOV┬ ì
  211. anΣ HMOVB├ arσ usefu∞ wheε furthe≥ processinτ froφ thσ las⌠ poin⌠ ì
  212. filleΣ i≤ desired.
  213.  
  214.      Inputs:  HL points to the first byte of the buffer to move
  215.               DE points to the first byte of the buffer to move to
  216.               B (for MOVEB) or BC (for MOVEBC) = number of bytes in buffer
  217.  
  218.  
  219.      Outputs:  None for MOVEB and MOVEBC (Buffer is moved)
  220.                HL and DE pt to byte after last byte moved for
  221.                     HMOVB and HMOVBC
  222.  
  223.      Registers Affected:  None for MOVEB, MOVBC; HL, DE for
  224.                               HMOVB, HMOVBC
  225.  
  226.      SYSLIB Routines Called:  -None-
  227.  
  228.      Special Error Conditions:  -None-
  229.  
  230. :Delay Routine
  231.  
  232.      Routine Name:  PAUSE
  233.      Function:
  234.           Delay N 10ths of a Second.
  235.      Inputs:  HL = N (Number of 10ths of a Second Delay desired)
  236.               B = Processor Speed in MHz (1, 2, 3, 4, ...)
  237.      Outputs:  None (Routine returns N 10ths of a Second later)
  238.      Registers Affected:  None
  239.      SYSLIB Routines Called:  None
  240.      Special Error Conditons:  None
  241.  
  242.  
  243. :Version Number of SYSLIB
  244.  
  245.      Routine Name:  VERSION
  246.      Function:
  247.           Return Version Number of SYSLIB.
  248.      Inputs:  None
  249.      Outputs║  HL=Versioε (H=Major¼ L=Minor╗ H=2¼ L=▒ fo≥ 2.1)
  250.      Registers Affected:  HL
  251.      SYSLIB Routines Called:  None
  252.      Special Error Conditions:  None
  253.  
  254.