Re: Re: A86: Instruction set question?


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

Re: Re: A86: Instruction set question?




In a message dated 9/17/97, Andres wrote:

>O.K. Sya Im making a looping functions which loads a label to hl.
>
>ld hl,Labels
>
>
>I then want hl to go to that label and load other address.
>
>Do I do this
>
>Labels:
>
>	.db Page1     ;This is the label
>	.db Page2
>
>Then how do I load Page1 to hl?
>
>
>That way I can just load hl with one label (Labels) and have a loop do the
>rest.
>
>
>Andres

As far as I know you only have two choices, 1:

ld		de,nn	;where nn=the byte length of Page1
add	hl,de	;now hl points to Page2

The other one is to have two labels:

Page1:
	.db "Page1",0
Page2:
	.db "Page2",0

Well you get the idea.  Then you just say:  'ld hl,Page2' in the loop.

~Chris Hawkins