Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gcc-ia16] Put literal strings and constant structures in ROM memory by default #7

Open
asiekierka opened this issue Aug 20, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed target: wswan Affects the wswan/wwitch targets

Comments

@asiekierka
Copy link
Contributor

asiekierka commented Aug 20, 2023

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.

This is a rather difficult task, unfortunately.

@asiekierka asiekierka added enhancement New feature or request help wanted Extra attention is needed target: wswan Affects the wswan/wwitch targets labels Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed target: wswan Affects the wswan/wwitch targets
Projects
None yet
Development

No branches or pull requests

1 participant