We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, i am using 8052 in my project and according to datasheet the data memory is 256 bytes but in my code if i exceed 128 bytes the code is not compiled do i need to use it as x data memory? please help
"I consider the assumption "I realise you are unfamiliar with dynamic memory allocation" very rude." It was merely an observation based on your statements which clearly show that you don't understand how dynamic memory allocation works. "whatever, you are totally missing the point. the issue is neither "how much memory is used" nor "memory being made available" BUT how much memory available at the call." Surely you can understand that if you know how much memory has been used from a fixed size pool you know how much memory is available? It's simple arithmetic. "and so are you. when are you going to understand: The '51 ain't no PC" I don't know why you keep saying this - it is quite obvious that an 8051 is not a PC. Is this some sort of catchphrase? "now, who is being rude now" I have no desire to be rude, I'm merely making an observation. "You, Sir evidently am not "VERY "familiar with dynamic memory allocation", using it on the '51 architecture indicate total ignorance of the effect of archiecture on this call." You're clearly a very opinionated chap with very fixed ideas about what is right and what is wrong. I've put forwards a scenario where dynamic memory allocation can be a good thing even in an 8 bit microcontroller environment, for one reason or another you either cannot or will not try to understand it. Well, that's fine by me - I give up. By the way, there's really no need to call me 'Sir'. It has quite a nice colonial touch but is probably redundant in the 21st century. Have a good weekend.
Surely you can understand that if you know how much memory has been used from a fixed size pool you know how much memory is available? It's simple arithmetic.
again you talk apples I talk oranges
If you use malloc to allocate 1234 bytes, YES you know you have allocated 1234 bytes. What I am trying to state is that you do not know at the time of the malloc call if the 1234 bytea are available.
One issue I have forgotten is that with dynamic memory allocation you get one added level of indirection (one thing the '51 architecture is terrible at)
My approach to "dynamic memory allocation" for the '51 (I gladly use malloc() when coding for a PC) is to have workbuffer[] together with a flag "workbuffer in use" That way you can share the memory space and avoid more indirection than needed.
You have a good weekend too.
Erik