Right now, constant structures have to be explicitly annotated with __far to be placed in ROM memory. This is less than ideal:
Existing code most likely doesn't use the __far annotation, requiring adaptation;
Literal strings cannot be placed in ROM memory at all.
There are many options to improve this:
Patch gcc-ia16 to place literal strings in .fartext and as __far-annotated variables;
Patch gcc-ia16 to place read-only data in .farrodata and as __far-annotated unless __near is present;
Patch gcc-ia16 to support placing variables in the code segment; this would allow using CS-relative pointers for a slight performance benefit compared to __far annotations for literal strings.
Add a large memory model to gcc-ia16, as the times when we want a near pointer are notably less numerious than times when we want a far pointer.
Right now, constant structures have to be explicitly annotated with
__far
to be placed in ROM memory. This is less than ideal:__far
annotation, requiring adaptation;There are many options to improve this:
.fartext
and as__far
-annotated variables;.farrodata
and as__far
-annotated unless__near
is present;__far
annotations for literal strings.large
memory model togcc-ia16
, as the times when we want a near pointer are notably less numerious than times when we want a far pointer.This is a rather difficult task, unfortunately.