?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  ifndef included_xOP1mul10
  2.  define included_xOP1mul10
  3.  include "../../common/mov.asm"
  4.  include "../routines/add64.asm"
  5. xOP1mul10:
  6. ;Note! Does not check for special numbers! Does not check overflow!
  7.   ld hl,xOP1
  8.   ld de,xOP2
  9.   call mov8
  10.   ; ld hl,xOP1+8 ; useless thanks to the 8x LDI's just before...
  11.   ld a,3
  12.   add a,(hl)
  13.   ld (hl),a
  14.   jr nc,xOP1mul10_noincHSB;+_
  15.   inc_hl_opt (xOP1+8)
  16.   inc (hl)
  17. xOP1mul10_noincHSB;_:
  18.  if ((xOP2+7)>>8)==((xOP1+8)>>8)
  19.   ld l,255&(xOP2+7)
  20.  else
  21.   ld hl,xOP2+7
  22.  endif
  23.  
  24.   srl (hl) : dec_hl_opt (xOP2+7)
  25.   rr (hl) : dec_hl_opt (xOP2+6)
  26.   rr (hl) : dec_hl_opt (xOP2+5)
  27.   rr (hl) : dec_hl_opt (xOP2+4)
  28.   rr (hl) : dec_hl_opt (xOP2+3)
  29.   rr (hl) : dec_hl_opt (xOP2+2)
  30.   rr (hl) : dec_hl_opt (xOP2+1)
  31.   rr (hl)
  32.  if ((xOP2+7)>>8)==(xOP2>>8)
  33.   ld l,255&(xOP2+7)
  34.  else
  35.   ld hl,xOP2+7
  36.  endif
  37.   srl (hl) : dec_hl_opt (xOP2+7)
  38.   rr (hl) : dec_hl_opt (xOP2+6)
  39.   rr (hl) : dec_hl_opt (xOP2+5)
  40.   rr (hl) : dec_hl_opt (xOP2+4)
  41.   rr (hl) : dec_hl_opt (xOP2+3)
  42.   rr (hl) : dec_hl_opt (xOP2+2)
  43.   rr (hl) : dec_hl_opt (xOP2+1)
  44.   rr (hl)
  45.   ld de,xOP1
  46.   call adc64
  47.   ret nc
  48.  if ((xOP1+8)>>8)==(xOP2>>8)
  49.   ld l,255&(xOP1+8)
  50.  else
  51.   ld hl,xOP1+8
  52.  endif
  53.   inc (hl)
  54.   jr nz,$+2+1+1;+_
  55.   inc l
  56.   inc (hl)
  57. ;_:
  58.   ex de,hl
  59.   rr (hl) : dec_hl_opt (xOP1+7)
  60.   rr (hl) : dec_hl_opt (xOP1+6)
  61.   rr (hl) : dec_hl_opt (xOP1+5)
  62.   rr (hl) : dec_hl_opt (xOP1+4)
  63.   rr (hl) : dec_hl_opt (xOP1+3)
  64.   rr (hl) : dec_hl_opt (xOP1+2)
  65.   rr (hl) : dec_hl_opt (xOP1+1)
  66.   rr (hl)
  67.   ret
  68.  endif
  69.