Simulator Write Error

misellers

New Member
I have a program that is reported by the syntax checker as 226 bytes long destined for an 08-M.
Using the simulator the program runs fine until it reaches:
Write 226,b1
At which point I get a "write error-overwriting program"
I've tried using higher memory locations but still get the same message.
Suggestions gratefully received.
Matthew
 

westaust55

Moderator
With the 08M, the program and data memory are shared - that is, one and the same.
The program is stored in the memory from the top down. The data needs to be stored from the bottom up.

The 2 line program:
write 254, b0
end​
will give the error you mention.

The 2 line program:
write 0, b0
end​
will work okay.

If your program is 226 bytes in size, then you have approximately 30 bytes at the bottom for data.
I say approximate as sometiem the PE apparently does report the wrong size by abyte or two.
 
Last edited:

hippy

Ex-Staff (retired)
One recommendation is to reserve space for your Eeprom writes by using the EEPROM command specifying the address you are going to write to ...

Eeprom 226,( 0 )

This will let the compiler detect where the are going to be problems.

As westaust55 indicates both program code and Eeprom space start at zero from opposing directions. Think of a 256 page book which you ( the Code ) and a friend ( the Eeprom ) can both use; your pages 0 to X start from the front, their pages 0 to Y start from the back.

If the code uses 226 bytes, out of 256, that's around 30 left, numbered 0 to 29 ( give or take a byte or two as westaust55 notes ).
 
Top