3 ms·
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/r
by livrem 3y ago
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 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.