??? 06/13/07 13:03 Read: times |
#140661 - overlayed variables Responding to: ???'s previous message |
Of course I AM using overlayed variables in asm. Even more, I use also stack, and I believe I do that more efficiently any compiler ever would. What, you take up an another bunch of RAM for each routine (never being nested in each other) just to store some temporary values?
Oh well, in asm, one needs to THINK... :-) I am sure in most of the cases I'll be able to beat any C compiler in both code and RAM usage and I am quite confident I could also achieve comparable "speed" when programming in asm compared to somebody coding in C, up to a moderate size of both code (say, a couple of kB of resulting binary) and RAM space. But when I will most probably have significant troubles with asm is the mentioned moving variables from RAM to XRAM - whereas it is a <SNAP> for the C programmer. The main reason is, that while the variables are in directly or indirecly accessible IRAM, one can use a whole spectrum of '51 instructions for them; whereas in XRAM the only way is to move around with MOVX. Would I start with the premise that once I will have to move the variables I could imagine myself using only MOV @Ri to access such variables, but the need for such move usually arises from originally unplanned changes. Other than that and a couple of religious reasons which are too ridiculous to be taken seriously, there is almost no difference between coding in C and programming in asm. JW |