Re: A83: Re: Re: Problem with a program


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

Re: A83: Re: Re: Problem with a program




Or you could do something like this:
ld b,0
ld c,b
Loop:
djnz Loop
dec c \ jr nz Loop

I think that's what James meant.

----- Original Message ----- 
From: <ComAsYuAre@aol.com>
To: <assembly-83@lists.ticalc.org>
Sent: Friday, December 10, 1999 3:44 AM
Subject: Re: A83: Re: Re: Problem with a program


In a message dated 12/10/99 5:45:00 AM Eastern Standard Time, 
jjj@matthewsfamily.fsnet.co.uk writes:

> Actually, you could just use a 16-bit register to control a DJNZ loop (you
>  CAN do that can't you?...lol) and do all the tough mathematics in the OP
>  registers. Generating 100,000 random numbers on an 8Mhz chip will be slow 
no
>  matter :)

djnz only works with b.   If you want to loop >256 times (if b=0 it will loop 
256 times with djnz), then use bc like this:

 ld bc,20000
loop:
 push bc
 ;...code
 pop bc
 dec bc
 ld a,b
 or c
 jr nz,loop


----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/




Follow-Ups: References: