Pascal users have already adopted single letter T prefix (as in TMyType) for type declarations, P prefix for pointers (as in PMyRecord), I prefix for interfaces (as in IMyInterface), and F prefix for fields (as in FMyField). I would exploit such habbit and naming convention, and simply extend it by defining X prefix for bits in a set (as xCF0A) and M prefix for bit masks (as mCF0A). And yes, I would prefer those two single letter prefixes to be lower case since that would visually more stand out during code completetion and ease distinction quite a bit.
So far
e and
m prefixes generate identifier clashes.
s seems good to use for the set element names.
I do not see a problem with forcing variables to be stored into specific registers. A typical AT MEGA memory map starts with something like 0x0000 – 0x001F (registers R0 – R31). So all we need is to try it this way:
var
R0: byte absolute $00; // these definitions should go to cpu unit
R1: byte absolute $01;
// ...
var
MyByte: byte absolute R0; // these definitions go to user code
Of course we need to be extra carefull, but it is doable.
This concept does kind of work (except for
r0: byte absolute 0;). The one problem remains the adopted ABI which in principle consume all general CPU registers. Another problem is the access to the underlying register via the variable - this requires LDS/STS instructions, which then needs to put the data into... some register
. Probably useful for user code debugging tricks which dump register content, but not useful to speed up critical data access.
I would also like to be able to define address after absolute keyword only on first variable, and then compiler takes care of all following variables having absolute keyword without address parameter. Unfortunatelly that is not possible with FPC, but sounds like a good candidate for a feature request.
Has been possible in FPC
trunk for a couple of months now.