Re: A86: divide by 2
[Prev][Next][Index][Thread]
Re: A86: divide by 2
In a message dated 3/3/99 6:43:52 PM Eastern Standard Time, e1066@sherbtel.net
writes:
> I need to write an algorithm in z80 to divide by two. I need to do it
> with on add and sub (no mult). I know i should be able to figure this out
> but i can't. Please help.
> Also, the 86 displays about 12-14 digits on the screen (right?). After
> that it goes to scientific notation (n * 10 ^ x). I thought I heard
> somewhere that the 86 does internal calculations much more accurately. Can
> anyone tell me about this, and is there any to access this internal value?
sra-shift right arithmetic
this will shift a 8 bit register one to the right, effectively dividing its
value by two
ex:
sra a ;shift the accumulator one to the right
it displays 12 digits, but stores 14. you always access the 14 when doing
calculations, but it won't display more than 12.