0 Members and 2 Guests are viewing this topic.
; hldebc = hla * cde, a = 0 ld b,0 push hl ld l,b ld h,a ld ix,0 ld a,24Loop: add ix,ix adc hl,hl ex (sp),hl adc hl,hl ex (sp),hl jr nc,Next add ix,de adc hl,bc jr nc,Next ex (sp),hl inc hl ex (sp),hlNext: dec a jr nz,Loop pop de ex de,hl push ix ; ld c,ixl pop bc ; ld b,ixh
; hldebc = hlc * bde ld (iy+asm_Flag1),b xor a ld ix,0 ld b,24Loop: add ix,ix rla rl c adc hl,hl jr nc,Next add ix,de adc a,(iy+asm_Flag1) rl c jr nc,Next inc hlNext: djnz Loop ld e,a ld d,c push ix ; ld c,ixl pop bc ; ld b,ixh
Ok, this is a bit of a stretch, but how about square-rooting a 24-bit number