32-bit divide/multiply
ZXNet echo conference «real.speccy»
From Valerij Kozhevnikoff → To All 4 December 2002
Hello, All!
We need quick subject procedures.
Does anyone know how to do this? And what is the result?
At the same time, you can compare 16-bit with mine.
;BC=BC/DE
;HL=remainder
DIV LD A,B
LD B,#10
LD HL,0
DIV1 RL C
RLA
ADC HL,HL
SBC HL,DE
JR NC,DIV2
ADD HL,DE
DIV2 CCF
DJNZ DIV1
RL C
RLA
LD B,A
RET
;HLBC=DE*BC
MUL LD HL,0
LD A,17
MUL0 RR B
RR C
DEC A
RET Z
JR NC,$+3
ADD HL,DE
RR H
RR L
JP MUL0
WBR, Jason.
/*e-mail: jason2000(scary dog)yandex.ru ICQ: 62235830*/
/np:/ *silence*