Recent

Author Topic: Flat memory  (Read 1475 times)

julkas

  • Guest
Flat memory
« on: July 14, 2019, 03:37:50 pm »
Has anyone worked on this in the past (especially German users)?
http://swag.outpostbbs.net/MEMORY/0099.PAS.html
« Last Edit: July 14, 2019, 03:39:36 pm by julkas »

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: Flat memory
« Reply #1 on: July 14, 2019, 04:04:18 pm »
What would you want to use it for? It'll run in DOSBOX, but not much else. All 32/64 bit processors already have a flat memory space.

Basically, in 32-bit mode, you can either use segments or pages. And everyone uses pages. The CPU needs to have a Memory Management Unit to use either. The main difference is, that with paging the OS and MMU do it invisibly for you.

Thaddy

  • Hero Member
  • *****
  • Posts: 14358
  • Sensorship about opinions does not belong here.
Re: Flat memory
« Reply #2 on: July 14, 2019, 06:08:43 pm »
Flat memory depends on how much you want to be flat ( High(NativeUint) or page size) and the way the OS treats memory allocation, so this is never (well, hardly) a predetermined case.
It is also rarely necessary. If you need it, you need preallocated lots of memory, which is hardly desirable.

Memory is flat given resolution. If you exceed that - whatever the size - it is not guaranteed to be flat.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Flat memory
« Reply #3 on: July 14, 2019, 09:04:46 pm »
Using a "home-brew" flat memory model is only a bonus (and a relative one, at that) if your program runs in real mode. It's one of the ways of breaking the 1MiB barrier.

FPC programs already run in protected mode so (in DOS) they are already running in something like "flat-memory". Nothing more is needed.

Note that the SWAG snippets are meant for 16 bit Turbo Pascal/Delphi for DOS/Windows 3. FPC is in quite another category. :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5462
  • Compiler Developer
Re: Flat memory
« Reply #4 on: July 15, 2019, 09:24:21 am »
Note that the SWAG snippets are meant for 16 bit Turbo Pascal/Delphi for DOS/Windows 3. FPC is in quite another category. :)
Except if one is using FPC's i8086 targets (msdos, win16, embedded), then it might be useful. ;)

Thaddy

  • Hero Member
  • *****
  • Posts: 14358
  • Sensorship about opinions does not belong here.
Re: Flat memory
« Reply #5 on: July 15, 2019, 09:40:33 am »
Quite.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018