VOGONS


Reply 20 of 23, by Deunan

User metadata
Rank Oldbie
Rank
Oldbie

That page is a bit apples/oranges comparison. So first of all it's for 286, where everything is still 16-bit. To use any kind of simplified addressing in C (something that at least resembles flat mode of 386+) you'd need far pointers for everything so that you can easily address up to 16MB and not worry about segments. Actually it's not that simple since you are still limited to 64k segment sizes, trying a longer read or write will cause GP fault. But other than that it looks close in C. But there is a heavy price to pay - all your pointers are now 32-bit, with both segment and offset part. And 286 still has only one segment register usable for such operations: ES, since you need DS for program local data and CS/SS are out of the question obviously. DS can be used in some leaf functions but not a whole lot.

So now your pointers are twice as costly to load/store, put some serious register pressure on the compiler which will be resolved by a lot of storing/restoring on the stack (even more costly as far as memory accesses go). Then there is the issue of going in and out of protected mode which is _very_ costly on 286 no matter the method used. If your code is mixed or you are trapping real-mode interrupts (or calling the OS often) it's going to be very slow. 386+ DOS extenders don't suffer as much due to much cheaper transition (and, potentially, one could also use V86 mode instead of true real mode, this might be beneficial in some cases).

Lastly the comparison used Sarien, which does compile with Turbo C I guess but the way the code is written is not at all nice for old machines. Obviously the older the compiler used the worse the generated code will be as well. When you switch from pretty well optimized Compact memory model, with a lot of code written to avoid any memory limit issues by the programmer in the first place, to Huge model where "everything just works" but at a heavy price and then you slap protected mode extender on top of it but you need to switch in and out still - well... expect things to be slow.

There is a reason 286 never really took off, esp. the protected mode. It's only with 386+ and flat addressing where you could drop all the segment tricks and not worry about them anymore, with some performance impact but not so great that it would stop you from going DOS extender all the way. And compilers only got better at code generation too, Watcom was great and showed everyone what you can do when registers are now really general purpose.

Reply 21 of 23, by Marco

User metadata
Rank Member
Rank
Member

👍🏻👍🏻

1) VLSI SCAMP 311 | 386SX25@30 | 16MB | CL-GD5434 | CT2830| SCC-1 | MT32 | Fast-SCSI AHA 1542CF + BlueSCSI v2/15k U320
2) SIS486 | 486DX/2 66(@80) | 32MB | TGUI9440 | SG NX Pro 16 | LAPC-I

Reply 22 of 23, by Minutemanqvs

User metadata
Rank Member
Rank
Member

I have nothing to add, but reading this thread and related links in amazing. Thanks 😀

Searching a Nexgen Nx586 with FPU, PM me if you have one. I have some Athlon MP systems and cookies.

Reply 23 of 23, by Marco

User metadata
Rank Member
Rank
Member

Error correction just for correctness: lsl6cd is indeed already using Dos4gw. Anyway very fast for svga.
The lsl7demo can’t even reproduce audio seamless.

1) VLSI SCAMP 311 | 386SX25@30 | 16MB | CL-GD5434 | CT2830| SCC-1 | MT32 | Fast-SCSI AHA 1542CF + BlueSCSI v2/15k U320
2) SIS486 | 486DX/2 66(@80) | 32MB | TGUI9440 | SG NX Pro 16 | LAPC-I