GOTO (arithmetical expression) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: GOTO (arithmetical expression) (/showthread.php?tid=351) |
GOTO (arithmetical expression) - JBGV - 05-09-2011 Hello! Could anyone tell me how I can simulate "GOTO (arithmetical expression)": ex: Code: N can have a value between 1 and 20 I need to assign values to an array depends on the value "N", I had thought something like this: Code: ASM Is this efficient? Is there a danger that the program itself erase the data stored at positions 62000? THANKS Re: GOTO (arithmetical expression) - LCD - 05-11-2011 Line numbers? this is stone age! just make a buffer and calculate the offset to copy the data from memory to variable array. pseudocode, as I'm at work now: Code: address=@labelofdata+size*n This if efficiency! GoTo calculation was working only in HiSoft Basic compiler, but you had do define all possible lines for calculated jumps with REM: GOTO directive. With more programming experience there is absolutly no need for calculated goto. Re: GOTO (arithmetical expression) - JBGV - 05-11-2011 Copymemory, Thanks ¡ |