home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part3 / 6809 / prabs.u < prev    next >
Encoding:
Text File  |  1986-11-30  |  432 b   |  28 lines

  1. |    prabs.  converts both args to unsigned, and
  2. |    remembers result sign as sign a eor sign b
  3. |    used only by divide support
  4. |    result d contains right, sign is non-zero
  5. |    if result (from divide) should be negative.
  6. |
  7. |
  8. .globl prabs
  9.     left=8.
  10.     right=4.
  11.     sign=3.
  12. prabs:    clr    sign(s)
  13.     ldd    left(s)
  14.     bge    tryr
  15.     nega
  16.     negb
  17.     sbca    #0
  18.     std    left(s)
  19.     inc    sign(s)
  20. tryr:    ldd    right(s)
  21.     bge    done
  22.     nega
  23.     negb
  24.     sbca    #0
  25.     dec    sign(s)
  26.     std    right(s)
  27. done:    rts
  28.