home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol089 / syslib7.hlp < prev    next >
Text File  |  1985-02-09  |  6KB  |  188 lines

  1. Introduction
  2. Arithmetic Operations -- Add, Subtract, Multiply, Divide
  3. Complement Operations -- Negate (2's Comp) and Complement (1's)
  4. Rotate and Shift Operations -- Left and Right
  5. Logical Operations -- And, Or, Xor
  6. :Introduction
  7.  
  8.      Thi≤á modulσá contain≤ ß se⌠ oµ 16-bi⌠á unsigneΣá arithmetiπ ì
  9. routines«á  Al∞ routine≤ usσ H╠ a≤ thσ accumulato≥ o≥ thσ result¼ ì
  10. anΣá H╠ anΣ D┼ contaiε thσ operand≤ requireΣ (iµ onl∙ onσ operanΣ ì
  11. is needed, HL contains it).
  12.  
  13.      The available routines are:
  14.  
  15.           ADDHD -- HL = HL + DE    SUBHD -- HL = HL - DE
  16.           MULHD -- HL = HL * DE    DIVHD -- HL = HL / DE
  17.           NEGH  -- HL = 2's Complement of HL
  18.           CMPH  -- HL = 1's Complement of HL
  19.           ROTLH -- HL is rotated left one bit position
  20.           ROTRH -- HL is rotated right one bit position
  21.           SHFTLH -- HL is shifted left one bit position
  22.           SHFTRH -- HL is shifted right one bit position
  23.           ANDHD  -- HL = HL AND DE
  24.           ORHD   -- HL = HL OR DE
  25.           XORHD  -- HL = HL XOR DE
  26.  
  27. :Arithmetic Operations -- ADDHD, SUBHD, MULHD, DIVHD
  28.  
  29.      Al∞á oµá thesσ routine≤ operatσ oε H╠ anΣá DE¼á placinτá thσ ì
  30. resul⌠á iε HL«á  Thσ Carr∙ Flaτ i≤ affected¼á frequentl∙ useΣá t∩ ì
  31. indicate overflow.
  32.  
  33.  
  34.      Routine Name:  ADDHD
  35.      Function║
  36.           HL = HL + DE
  37.      Inputs:  HL, DE are operands
  38.      Outputs:  HL is result, Carry Flag Set (C) means overflow
  39.      Registers Affected:  HL, PSW
  40.      SYSLIB Routines Called:  None
  41.      Specia∞á Erro≥ Conditions║  None
  42.  
  43.  
  44.      Routine Name:  SUBHD
  45.      Function║
  46.           HL = HL - DE
  47.      Inputs:  HL, DE are operands
  48.      Outputs:  HL is result, Carry Flag Set (C) if HL<DE
  49.      Registers Affected:  HL, PSW
  50.      SYSLIB Routines Called:  None
  51.      Specia∞á Erro≥ Conditions║  None
  52.  
  53.  
  54.      Routine Name:  MULHD
  55.      Function║
  56.           HL = HL * DE
  57.      Inputs:  HL, DE are operands
  58.      Outputs:  HL is result, Carry Set means Overflow
  59.      Registers Affected:  HL, PSW
  60.      SYSLIB Routines Called:  SHFTRH, SHFTLH
  61.      Specia∞á Erro≥ Conditions║  None
  62.      Note║á  Thi≤á routinσ i≤ optimizeΣ fo≥ speed¼á witΦ ßá mino≥ ì
  63. sacrificσá oε size¼á anΣ i⌠ alway≤ take≤ 1╢ loop≤ t∩ perforφá an∙ ì
  64. multiplication.
  65.  
  66.  
  67.      Routine Name:  DIVHD
  68.      Function║
  69.           HL = HL / DE
  70.      Inputs:  HL, DE are operands
  71.      Outputs:  HL is result
  72.      Registers Affected:  HL
  73.      SYSLIB Routines Called:  SHFTLH
  74.      Specia∞á Erro≥ Conditions║  None
  75.      Note║á  Thi≤á routinσ i≤ optimizeΣ fo≥ speed¼á witΦ ßá mino≥ ì
  76. sacrificσá oε size¼á anΣ i⌠ alway≤ take≤ 1╢ loop≤ t∩ perforφá an∙ ì
  77. division.
  78.  
  79. :Complement Operations -- NEGH and CMPH
  80.  
  81.      These routines operate on HL, placing the result into HL.
  82.  
  83.  
  84.      Routine Name:  NEGH
  85.      Function║
  86.           HL = 2's Complement of HL
  87.      Inputs:  HL is operand
  88.      Outputs:  HL is result
  89.      Registers Affected:  HL
  90.      SYSLIB Routines Called:  CMPH
  91.      Specia∞á Erro≥ Conditions║  None
  92.  
  93.  
  94.      Routine Name:  CMPH
  95.      Function║
  96.           HL = 1's Complement of HL
  97.      Inputs:  HL is operand
  98.      Outputs:  HL is result
  99.      Registers Affected:  HL
  100.      SYSLIB Routines Called:  None
  101.      Specia∞á Erro≥ Conditions║  None
  102.  
  103. :Rotate and Shift Operations -- ROTLH, ROTRH, SHFTLH, SHFTRH
  104.  
  105.  
  106.      These operations operate on HL, placing the result into HL.
  107.  
  108.  
  109.      Routine Name:  ROTLH
  110.      Function║
  111.           H╠á i≤á rotateΣá lef⌠ onσá bi⌠á position«á  Thi≤á i≤á ß ì
  112. circula≥á rotate¼á anΣá thσ mos⌠ significan⌠ bi⌠ oµ ╚ i≤á rotateΣ ì
  113. into the least significant bit position of L.
  114.      Inputs:  HL is operand
  115.      Outputs:  HL is result
  116.      Registers Affected:  HL
  117.      SYSLIB Routines Called:  None
  118.      Specia∞á Erro≥ Conditions║  None
  119.  
  120.  
  121.      Routine Name:  ROTRH
  122.      Function║
  123.           H╠á i≤á rotateΣá righ⌠ onσ bi⌠á position«á  Thi≤á i≤á ß ì
  124. circula≥á rotate¼á anΣ thσ leas⌠ significan⌠ bi⌠ oµ ╠ i≤á rotateΣ ì
  125. into the most significant bit position of H.
  126.      Inputs:  HL is operand
  127.      Outputs:  HL is result
  128.      Registers Affected:  HL
  129.      SYSLIB Routines Called:  None
  130.      Specia∞á Erro≥ Conditions║  None
  131.  
  132.  
  133.      Routine Name:  SHFTLH
  134.      Function║
  135.           H╠á i≤á shifteΣá lef⌠á onσá bi⌠á position«á  Thσá leas⌠ ì
  136. significant bit of L is filled with a Zero.
  137.      Inputs:  HL is operand
  138.      Outputs:  HL is result
  139.      Registers Affected:  HL
  140.      SYSLIB Routines Called:  None  
  141.      Specia∞á Erro≥ Conditions║  None
  142.  
  143.  
  144.      Routine Name:  SHFTRH
  145.      Function║
  146.           H╠á i≤á shifteΣá righ⌠á onσá bi⌠á position«á  Thσá mos⌠ ì
  147. significant bit of H is filled with a Zero.
  148.      Inputs:  HL is operand
  149.      Outputs:  HL is result
  150.      Registers Affected:  HL
  151.      SYSLIB Routines Called:  None  
  152.      Specia∞á Erro≥ Conditions║  None
  153.  
  154. :Logical Operations -- ANDHD, ORHD, XORHD
  155.  
  156.      These operate on HL and DE, placing the result into HL.
  157.  
  158.  
  159.      Routine Name:  ANDHD
  160.      Function║
  161.           HL = HL AND DE
  162.      Inputs:  HL and DE are operands
  163.      Outputs:  HL is result
  164.      Registers Affected:  HL
  165.      SYSLIB Routines Called:  None  
  166.      Specia∞á Erro≥ Conditions║  None
  167.  
  168.  
  169.      Routine Name:  ORHD
  170.      Function║
  171.           HL = HL OR DE
  172.      Inputs:  HL and DE are operands
  173.      Outputs:  HL is result
  174.      Registers Affected:  HL
  175.      SYSLIB Routines Called:  None  
  176.      Specia∞á Erro≥ Conditions║  None
  177.  
  178.  
  179.      Routine Name:  XORHD
  180.      Function║
  181.           HL = HL XOR DE
  182.      Inputs:  HL and DE are operands
  183.      Outputs:  HL is result
  184.      Registers Affected:  HL
  185.      SYSLIB Routines Called:  None
  186.      Specia∞á Erro≥ Conditions║  None
  187.  
  188.