Re: A83: combination labels


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

Re: A83: combination labels




Two words: Jump Table

gotoplaceA: ;1 = place1 2 = place2... etc
   ld d,0
   ld e,a
   dec e
   ld hl,placeJMPTable
   add hl,de
   jp (hl)

placeJMPTable .dw place1,place2,place3


Nathan Gaylinn wrote:
> 
> is there a way to combine two strings into one label name? Like if you
> have labels place1, place2, place2, etc. and wanted to jump to these
> labels based on the value of hl, or any other variable, how would this
> be done? It's easy to do cp 1: jp z, place1 but that is long and
> inefficient.
> 
> --
> "What, behind the rabbit?"-King Arthur
> The Heat Index   Nathang@firstva.com
>       http://users.firstva.com/Nathang
>  (\\_
> \(_;

-- 
Scott "_Wrath_" Dial
wrath@calc.org
ICQ#3608935
TimeCity Co-Lead Developer, AI - www.timecity.org
Member of TCPA - tcpa.calc.org


References: