News for hackers. Stuff that matters.
Re:80286 ATX mainboard based on the IBM 5170 AT PC by AshamedCaptain on Wednesday November 13, 2024 @08:38AM (#42125965)
I do agree with what you say and also have nice memories of 8086 segmentation. I find it funny that we are continuously forced to add workaround on top of workarounds to the flat address space in order to avoid accidental memory errors. Segmentation had all that decades ago, and easier debugability to begin with. But it is clear to me that we are moving again towards something like that, even if enforced at a different level.
Re:80286 ATX mainboard based on the IBM 5170 AT PC by PaulHoule on Wednesday November 13, 2024 @10:16AM (#42126747)
I did not mind programming the 16-bit x86 model in assembly. You could do a lot of things such as use segment register pointers (16 byte aligned) for "large" data structures which could themselves be addressed with ordinary 16 bit pointers and chained together to make "extra-large" structures.

Compilers like Turbo Pascal and Microsoft C all gave you a choice of which memory model you wanted to use, often you wrote programs where a 64k code and 64k data space is all you need.

Re:80286 ATX mainboard based on the IBM 5170 AT PC by rep_lodsb on Wednesday November 13, 2024 @11:14AM (#42127334)
Turbo Pascal actually didn't: IIRC versions 3.x and lower used the "small" model (they were also available for CP/M on Z80, where 64K was the entire address space anyway), then newer ones exclusively the "large" one.

TP forcing use of large pointers for everything, and its lack of even trivial peephole optimizations, probably contributed to the myth that C was somehow inherently more efficient.

Re:80286 ATX mainboard based on the IBM 5170 AT PC by burnt-resistor on Thursday November 14, 2024 @11:20AM (#42137720)
You misremembered.

[BT]P7 includes for compatibility: tiny (.COM), small, compact, medium, large, and large w/ overlays (which can use EMS when available). There are DPMI clients for [BT]P7 that make it possible to switch to protected mode and use more memory.

It definitely generated offset-only pointers in the tiny, small, and medium memory models because that's how they referred to data with the common DS segment. I did plenty of memory and instruction-level debugging in [BT] Profiler/Debugger and inspected plenty of pointers where they lived in RAM.

Re:80286 ATX mainboard based on the IBM 5170 AT PC by rep_lodsb on Thursday November 14, 2024 @03:20PM (#42140751)
What command line option or compiler directive can I use to create a .COM program? How do I declare a near pointer variable?

http://bitsavers.trailing-edge.com/pdf/borland/turbo_pascal/...

Page 221: "A Pointer type is stored as two words"