Bernd Blaauw wrote:

Guess I should read up about what the difference is between these large/normal/small models.

In short:

tiny: one segment for everything, CS = DS = SS, data pointers are near, function pointers are near (everything must fit in in 64 KB, no segment reserved for stack and starts at 0100H so you can make a COM executable)

small: one segment for code and one segment for data, DS = SS, data pointers are near, function pointers are near (all code must fit in 64 KB, all data+stack must fit in 64 KB)

medium: multiple code segments and one data segment, DS = SS, data pointers are near, function pointers are far (all data+stack must fit in 64 KB)

compact: one code segments and multiple data segment, DS != SS, data pointers are far, function pointers are near (all code must fit in 64 KB)

large: multiple code segments and multiple data segment, DS != SS, data pointers are far, function pointers are far

huge: same as large, data pointers are huge

Each segment can be 64 KB max, so with medium and large models a single source file can generate up to 64 KB of code, and with compact and large models a single source file can contain up to 64 KB of data. The huge model permits data segments of more than 64 KB, huge pointers arithmetics is made in software so they can cross the 64 KB barrier. Some compiler has switches to force DS != SS with small and medium models, to permit to separate data and stack in two different segments, giving 64K data + 64K stack, but you must pay attention to pointers to data that resides on the stack, that have to be declared explicitly far. With tiny, small and medium model you can declare explicit far and huge data pointers and use farmalloc and farfree to allocate/deallocate DOS memory outside of the program image.

Ciao


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to