← Back to context

Comment by mjevans

3 years ago

I can't help but wonder if this is written in x86-16 bit mode to implicitly use Real Mode BIOS functions and platform interfaces as well.

There's something to be said for taking advantage of that existing code; but if that's a dependency it should be part of the environment manifest. Everything has (most things have) a context where it might be useful and that should be included in the explanation so a tool isn't misused and so incorrect expectations aren't set.

It’s written in x86-16 real mode because all immediates are smaller and switching to 32-bit mode takes a fair amount of code.

I would have preferred 32-bit mode because real mode is awkward with its seg:off addressing scheme.

Using the bios functions just allows it to have “not-boring” examples easily.

  • That's true, but it's still a sort of library dependency. Even for very tiny computers with a lot of hardware assistance, the basic ROM for communicating with the world in a useful way is bigger.