Memory Location Already Used Is there a known reason for this?

Hello my first post here, I am using PICAXE VSM to simulate my circuit and the PICAXE programming editor to write my code.

The program im writing is for a 28x1 chip. Last night I got an error "Memory Location Already Used" in the VSM, the programming editor syntax checker says Im using 1377 bytes out of 4096 and my program is only 550 lines long. In the program the only variables I had used where the standard b0, b1, w0 ,w1 etc, I hadn't used the scratch pad or other memory.

Little bit more info, I rewrote some of the code this morning using the scratch pad instead of the standard variables, the syntax checker reported an increase in program size to 1419 bytes but now the program runs without the memory allocation error in PICAXE VSM.

So anyone know why I'm getting this error when using the standard variables? and how I can be rid of it (other than not using those variables or writing less code)?

Thanks for your responses
 
I was just generalising when I gave those particular variable numbers. I'm only using b8 onward and have reserved B0 to B7 for use as w0,w1,w2,w3. :)
 
I'm slowly norrowing the problem down, I think it has something to do with my extensive use of Serout. I also had something interesting happen, I got another error message in the VSM telling me that hibernate is not yet supported, I find this interesting since I haven't actually used the hibernate command
 
It seems to run fine in the Picaxe program editor simulator, I have made a new version that currently doesn't make use of the scratch pad, still getting the same error in the VSM though. Will I be ok to try this out on real hardware or should I get the simultion (VSM) working first?

Thanks

View attachment LaserTag Mark II.bas
 

tiscando

Senior Member
Also, only if you go beyond 2048 bytes out of 4096 in VSM, you may get the VSM post-4000 bug where, once the program steps onto a command beyond address 4000 (near the end of the program), it starts misbehaving very confusingly (you may see 'no source line' messages) and stops working.
The addresses of each command in the VSM program window are shown as turquoise HEX numbers on the left. If you can't see them, right-click the window and tick 'Display Addresses'. If there is an address greater than 4000 (or 3F00), problems may develop.

That's something to bear in mind in case that happens The real chip should be fine. Also, I've never used variables beyond b20 yet.
Could there be something to do with { and } in VSM? (I also never used these before)

w0 = b1:b0
w1 = b3:b2
w2 = b5:b4
w3 = b7:b6
 
Last edited:
Thanks for the reply. Yea VSM throws an error on the {} but I find them useful in the programming editor so I keep them :) I've realised that the problem must be the VSM so Im just simulating in the programmin editor for now
 
Top