A85: Re: a div 6


[Prev][Next][Index][Thread]

A85: Re: a div 6




Wouldn;t the following work ?

ld b,a
sub a
bit 7,b
jr z, l1
add a,%10101
l1:
bit 6,b
jr z,l2
add a,%1011
l2:
bit 5,b
jr z,l3
add a,%11
l3:
bit 4,b
jr z,l4
add a,1
l4:
ret

----- Original Message ----- 
From: Kaus <kaus@cybrzn.com>
To: <assembly-85@lists.ticalc.org>
Sent: Saturday, November 28, 1998 11:40 PM
Subject: A85: a div 6


>
>can anyone give me some z80 asm for getting the integer division of a
>deivided by 6???
>quick, hackiest thing you can think of.
>im stumped. there should be a way to do this, but i cant find it. the only
>way i can think of would be to take a-6 and inc until a-6<0, then dont inc
>and you are done. this would suck bad, but i may have to use it.
>