20M2 RAM addressing

PADJ

Member
On page 11 on Manual 2 it says
Indirect Addressing of General Purpose Variables (M2/X2 parts)
On these parts there are up to 256 general purpose variables. The lower bytes,
known as b0, b1, b2 etc upwards, can be used directly in any command (as with
all other PICAXE parts). All 256 bytes (0-255) can also be addressed both
directly and indirectly.
But in appendix 6 it says there are 512 bytes, and this is what the simulator shows.

So how do I access the ram above 256? I tried forum search but got 500 irrelevant threads.

EDIT: by further experimentation it appears that bptr is a 9 bit register, and can be used?
 
Last edited:

Technical

Technical Support
Staff member
Yes that page is a bit out of date.

Just use peek/poke on any address up to 511
or @bptr with bptr = 0 to 511
 

lbenson

Senior Member
@bptr can be used to address RAM above address 255. Documentation indicated that bptr is a byte variable, but for the M2 devices, it is a word.
 
Top