Can you tell me an example or something like that ? I need to somehow visualise it. Like variable X is in I don't know in first free byte it happens to be 0x20h and Y in 0x21hIn general, you do not overwrite data because the data is stored in its own place.
When you declare two variables, X and Y, they are allocated separate space in RAM.
One area of concern is in array storage, such as strings.
If you declare an array with 10 characters and you attempt to write 11 characters then, of course, you are asking for trouble.
Okey so they do not overwrite.
My question wasn't of adding new character to already existing. The example was :
- There is a existing data in byte 0x19h and it contained which diodes must turn on we have 8 LEDs so you know 8 bits 8 LEDs.
- I have array with 20 characters so if it is stored in the first free byte then it would be 0x00h right ? It is free only 0x19h is occupied. So 20 character then is it 0x00 (first character) 0x01 (second etc...), 0x02 .... it skips 0x19h and it is stored then in 0x20h ?
- If yes then how the program know what the array end in 0x20h byte and that 0x19h is not a character ? Can something like that happen ?
MCS-51 is a very old model and you need to move away from that model.
More recent models (though many years old too) are MSP430 and Atmel AVR.
Have a look at this.
https://www.nxp.com/docs/en/reference-manual/M68HC05TB.pdf
Then everything I know is useless ? I cannot compare MCS with STM32 with managing the stored data ?
Why does it work that I don't have to worry about it ? That let's say I have some stored data I don't know where because you said it is not important and I use one byte for something and Accidently it was occupied but I didn't know because I didn't put attention to it.
I tried to show an example before like : the lowest bit of a ram registor was (lowest free byte) 0x30h and it was first byte, then the UART clears it's 8 bit storage and takes another character and stores it in for example 0x31h (another lowest free byte because 0x30h is occupied) because it is now the lowest free byte.
Also is Bank/R0/R1 can be also treated as first free byte ?
These quotes are incorrect ?
Sorry for taking the time, soon I will gather what I understood write an big answer and close it because I probably this post is to long for me having a hard time ;>
Sorry, my bad trying to understand everything at once and accidently create new questions.You have asked many questions all at once and I have lost track of what is your question.
Ask one question and let’s see if we can give you the appropriate answer.



