Hacker News new | ask | show | jobs
by peterfirefly 5 hours ago
Could have been fixed with an ADC-type instruction that operated on segments.

Imagine if you could have done something like this:

   add  si, some-delta
   adsc es, 0
in order to move a seg:ofs ptr forward by 'some-delta' bytes.

ADSC (add with segment carry) would do:

   segreg := segreg + imm + 1000h (if carry)
or:

   segreg := segreg + imm  (no carry)
Maybe there should also have been an instruction to normalize a seg:ofs ptr (so the new offset was in the 0-15 range).

ADSC could have been adapted for the 286 with ease, as long as a specific layout of the segment descriptor tables was mandated (probably with 10h instead of 1000h in protected mode).

Edited slightly for clarity (ofs => imm). A normalizing instruction would be harder to do right for the 286 because you don't want to spend too many slots in the descriptor table(s) for a single memory object.