Variables

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Variables

theopavlakou
Hey guys, how do we actually create a variable? Like for instance I want to create a variable for the screen's first address called scrn or something, and throughout the loop I want to increment scrn to make it go through all the screen address' making M = -1 for 8192 times which will be another variable, which I know I can do with like @loopNumber then say M = 8192 and then keep decrementing it, but how do I do it with the screen i.e. how do I start from 16384 and go all the way through to (16384+8192)? Really is frustrating me :/

Thanks a lot guys
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Variables

cadet1620
Administrator
theopavlakou wrote
Hey guys, how do we actually create a variable? Like for instance I want to create a variable for the screen's first address called scrn or something, and throughout the loop I want to increment scrn to make it go through all the screen address' making M = -1 for 8192 times which will be another variable, which I know I can do with like @loopNumber then say M = 8192 and then keep decrementing it, but how do I do it with the screen i.e. how do I start from 16384 and go all the way through to (16384+8192)? Really is frustrating me :/

Thanks a lot guys
Variables are created when you first use them in your program.  Any symbol that is not a code label will be assigned a unique address in memory.  So at the start of your program all you need to do to initialize your scrn variable would be:
    @SCREEN
    D=A
    @scrn
    M=D
Later in the program when you want to increment scrn
    @scrn
    M=M+1
Loading...