@Address

Jeremy Leach

Senior Member
I don't think this is possible at the moment, but what I'd like as well as the @bPtr, is an @Address option, where you can actually specify the address in a statement.

For instance:
Code:
Symbol RAM_DampingFactor = 80 'RAM address 80
b0 = b1 + @RAM_DampingFactor
Where RAM_DampingFactor is a constant pointing to a RAM location...

I know this could be acheived using peek ..
Code:
Peek RAM_DampingFactor,b2
b0 = b1 + b2
Or , could be acheived if Bptr is set first ...
Code:
Bprt = RAM_DampingFactor
b0 = b1 + @Bptr
But it would be slick if the peek could be accomplished as part of the calculation. I expect this isn't possible to acheive though, without a big change to the way calcs are performed. Just thought I'd mention it though :)
 

Jeremy Leach

Senior Member
Answering myself here (!), but I guess the abundance of 'b' variables on X2s makes it less necessary to store variables in RAM accessed by Peek and Poke.

Another thought though - I wonder why you can't just have the whole RAM filled with picaxe general purpose variables b0 to b256 (or whatever) and then have the option of accessing the data either using poke or peek or via the direct variable name??
 

hippy

Ex-Staff (retired)
One consideration has to be size of tokenised program code generated - Having 16 variables (b0-b15) notionally requires 4-bits to indicate which it is whereas 256 variables (b0-b255) notionally requires 8-bits. That would make all tokenised programs larger and reduce the number of lines of source code. Likewise every byte variable could have its component bit variables exposed (bit0-bit2048) but it would then need around 13-bits to identify which of all particular variables is referenced.

I imagine that the balance is based upon how many bits are required to hold which 'core variables' are considered essential for a PICAXE's size then any unused token values are handed over for additional named variable use. Hence b0-b13/w0-w6 rather than the b0-b15/w0-w7 one may have expected; adding the b14/b15, although a seemingly small addition, has a much larger impact on tokenised code size than is reasonable.
 
Top