Re: LZ: zshell programming


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

Re: LZ: zshell programming



   To start with the if-like thingies, do not work all by themelves.  
If you have:
  
  ld a,10
  cp a,10
  ld de,10
 
10 will load into de no matter what, you must use a conditional branch 
statement to move to different parts of the program.
ex:


  ld a,(STRING)
  cp a,1
  jr z,GetStr1
  cp a,2
  jr z, GetStr2
  cp a,3
  jr z, GetStr3


GetStr1:
  ld de,p1
  jr Wherever


You can branch on several different conditions,
  z - equal
 nz - not equal
  c - carry set
  nc - carry not set


You could also set up some kind of table and index into it, which would 
be faster and take up less space, but which would have many confusing 
indirection operators.
(If you ask, I can show you an example, but it would take more than a 
couple of seconds to come up with! :)


Josh Pieper
ppieper@nemonet.com


References: