flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Hints about segmentation...

Author
Thread Post new topic Reply to topic
sid123



Joined: 30 Jul 2013
Posts: 340
Location: Asia, Singapore
sid123
Hi,
Been thinking about this lately, here's how I'll set up things for files more
than 64K.
1. First Load only the first 64K (little less), at 0x3000:0x0000
2. Then Load the other 64K (little lesser) at 0x4000:0x0000
3. Copy this code to somewhere at the end of segment 0x3000,
Code:
mov ax, 0x4000
mov es, ax
mov ds, ax
call 0x4000:0x0000
    

Enjoy up to 128K!
The loading part would be a little tougher since I would have to partially load the
file into RAM.
So is this possible?
What did DOS use? Can someone explain me or point to a link that theoretically describes
how the MZ Format functioned? What was the trick behind it?
Thanks,
sid123

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 11 Jan 2014, 16:15
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> So is this possible?

If you insist, YES.

> What does DOS use?

Segmentation.

> Can someone explain me or point to a link that theoretically describes
> how the MZ Format functioned? What was the trick behind it?

COM never has fixups, but MZ EXE has fixups if it has far calls.

RTFF (on the top of the DOS subforum):

http://board.flatassembler.net/topic.php?t=9473

http://board.flatassembler.net/topic.php?p=91767#91767
Post 11 Jan 2014, 16:52
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
sid123 wrote:

Enjoy up to 128K!


why don't you just allow access to the full 1MB? it seems to me that your trying to bend over backwards for a user code model that you can't even enforce. simply make the remaining regions dynamically allocatable and allow the user access to them by changing the value of the segment registers. that way the user can determine dynamically how much memory remains and act accordingly.

_________________
byte me.
Post 12 Jan 2014, 00:02
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.