A85: Re: Heya. :-) Need some help.


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

A85: Re: Heya. :-) Need some help.




The Mul 16 routine works for integers too.

>From Programming the Z80 by Rodney Zaks :

DIV16:
 LD HL,0
 LD B,16
Loop16:
  RL C
  RLA
ADC HL,HL
SBC HL,DE
JR NC,$+3
 ADD HL,DE
 CCF
 DJNZ Loop16 
 RL C
 RLA
 RET

(DIVIDEND IN AC
DIVISOR IN DE
QUOTIENT IN AC
REMAINDER IN HL)

Dines

-----Original Message-----
From: DorkReMi <DorkReMi@aol.com>
To: assembly-85@lists.ticalc.org <assembly-85@lists.ticalc.org>
Date: 22. maj 1998 21:44
Subject: A85: Heya. :-) Need some help.


>
>Hey you all, I've been gone due to grounding.  Got a favor to ask...
could
>someone tell me if the Mul16 routine in fixpoint.asm
>(http://www.ticalc.org/pub/85/asm/source/routines/fixpoint.asm)
>works with integers, i.e. It says it multiplies BC x DE and stores it in
BCDE.
>I need to know if it's doing funky decimal notation or working with
integers.
>Got my drift?  If you don't, then just post a routine that multiplies BC
x DE
>and stores it in BCDE. Thanks. :-S
>Also, could I be so pushy as to squeeze a routine from one of you that
divides
>one 16 bit no. by another 16 bit no.?  Don't worry about remainders, I
just
>need an integer approximation.  Thanks. :-D
>
>
>

_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________