0 Members and 1 Guest are viewing this topic.
DivAHLby10: ld d,a ld c,$0a sub a ld b,$18DAHLLoop1: add hl,hl ld e,a ld a,d adc a,a ld d,a ld a,e rla cp c jr c,DAHLLoop2 sub c inc lDAHLLoop2: djnz DAHLLoop1 ld e,a ld a,d ret
DivAHLby10: ld d,a ld bc,$180a sub aDAHLLoop1: add hl,hl rl d rla cp c jr c,DAHLLoop2 sub c inc lDAHLLoop2: djnz DAHLLoop1 ld e,a ld a,d ret
DivAHLby10: ld bc,$180a sub aDAHLLoop1: add hl,hl rl d rla cp c jr c,DAHLLoop2 sub c inc lDAHLLoop2: djnz DAHLLoop1 ret
DivAHLby10: ld bc,$150a sub a add hl,hl \ rl d \ rla add hl,hl \ rl d \ rla add hl,hl \ rl d \ rlaDAHLLoop1: add hl,hl rl d rla cp c jr c,DAHLLoop2 sub c inc lDAHLLoop2: djnz DAHLLoop1 ret
DivEHLby10:;Inputs:; EHL;Outputs:; EHL is the quotient; A is the remainder; D is not changed; BC is 10 ld bc,$050a sub a sla e \ rla sla e \ rla sla e \ rla sla e \ rla cp c jr c,$+4 sub c inc e djnz $-8 ld b,16 add hl,hl rla cp c jr c,$+4 sub c inc l djnz $-7 ret
Thanks alot Xeda, now I know who to go to for code.
That Pokemon Amber looks great!