A85: Re: Assembly-85 Digest V1 #481


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

A85: Re: Assembly-85 Digest V1 #481




This will not work at all, and I can point out a few things that might
help.  "ld de, 1 / add hl, de" = "inc hl" except that it takes three
bytes more and messes up de.  Even if you wanted de to be 1, you should
load it before the loop, which will save clock cycles. Also, at the
beginning of the loop HL is reset to a generic value (address) so even
though it is incremented each time it is then altered.  Here is a better
version:

ld b, 5
ld hl, $8000

Loop:

ld (hl), x
inc hl

djnz Loop

Justin Bosch
justin-b@juno.com

On Tue, 26 Jan 1999 19:00:02 EST MalcolmJ1@aol.com writes:
>
>try something like this:
>address	=$8000
>
>  ld b,5
>loop:
>  ld hl,address
>  ld de,1
>  add hl,de
>  dnjz loop
>
>In a message dated 1/26/99 6:00:21 PM Eastern Standard Time, owner-
>assembly-85-digest@lists.ticalc.org writes:
>
><< Hey,
>   I need to be able to access memory locations in a loop.
> How do I go about changing the location each time through the loop?
> For instance:
> 
> location = $xxxx  ;location is an initial memory address
> label:
>  ld a, x
>  ld (location),a
>  ; Somehow change location to next memory address
> goto label: 
>  ; I know its an inf. loop but its just an example.
> 
> Can anyone help with this? >>
>
>

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]


References: