torusle's comments

torusle | 2 years ago | on: MS-DOS v1.25 and v2.0 is now open-source (2014)

It wasn't that bad. You had different memory models back then. If you wanted to keep things easy you just compiled for a memory model in which each pointer was either 16 bit (for code/data smaller than 64kb) or a memory model with far pointers (access to all the memory).

There have been mixed memory models and you could go crazy with near and far to break out of the limits of the easy memory models.

Most of the time it was just a mater of picking a suitable memory model for your code and forget about near/far though. Not so different than today.

torusle | 2 years ago | on: MS-DOS v1.25 and v2.0 is now open-source (2014)

Oh, nice..

I browsed a little through the code, and found that sort.com used self-modified to change the sorting order:

  ; note! jae is patched to a jbe if file is to be sorted in reverse!
  ;
  CODE_PATCH LABEL BYTE
         JAE     INNER_SORT_LOOP

I committed similar crimes in the 90th as well, but that was just me as a teenager programming stupid games in asm for fun and giggles. Not for commercial software.

torusle | 2 years ago | on: GCC always assumes aligned pointer accesses (2020)

> If you're dealing with very simple CPUs like the > ARM M0, sure. But even the M3/M4 allows unaligned > access.

On ARM M3/M4 you have the same issue with LDRD and STRD instructions which do not allow unaligned access. Even the normal load/stores don't allow unaligned access in all cases. Try this in the peripheral memory region for starters. And things get even more complicated when the memory protection unit shakes up things.

page 2