News for hackers. Stuff that matters.
Re:Djgpp by livrem on Thursday January 18, 2024 @05:55AM (#39040312)
You do not need segment registers much if you stick to the tiny model. Here is someone compiling Rust to a 16-bit DOS COM executable:

https://github.com/o8vm/rust_dos

Not sure what the approach would be for them to expand that to support segments.

In DJGPP there are macros to allow your protected mode application access physical real-mode addresses (like when you want to write to video RAM). I don't know if IA-16 also does something like that, or if they added far/near keywords to the language like old 16-bit C compilers did (at least the ones I used).

Free Pascal has helper-functions to work with segment+offset pointer pairs, also without having to modify the language itself. I think that would work well enough in C, but I guess the old method of adding non-standard keywords was seen as slightly more convenient.

There are no comments on this comment yet.