this one
ought to be the the less memory hungry.Code:Z VAR WORD A VAR Z.LOWBYTE B VAR BYTE C VAR Z.HIGHBYTE D VAR BYTE ' ' Some other code where you set A, B, C & D BYTE variables ' Z.HIGHBYTE = Z.HIGHBYTE | (D<<4) Z.LOWBYTE = Z.LOWBYTE | (B<<4)
while changing the last two line by
should use more code space.Code:Z = Z | (B<<4) | (D<<12)
In the above A & C are Aliases, so shouldn't need any extra RAM.
this
ought to use load of RAM and time to execute... BUT this said, I'm rusty and my memory/capacity fade since few months...Code:z=a+b<<4+c<<8+d<<12



I might have coded it like Steve(mister_e) here and just got the job done. But, I guess, this is how compiler writers optimize their code generation capabilities. I would like to hazard a thought that this kind of optimisations would help PBP generate tighter code.


Bookmarks