[fpc-pascal] Compiling for DOS

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Nov 12 20:47:58 CET 2005


> No, FPC was being created as a protected-mode compiler from the very
> beginning.

Is it very different to compile for protect-mode DOS and real-mode DOS?

Interesting that FPC was based on TP 7, but TP 7 only compiled for real-mode.

> Yes, you can, although especially interrupts might be somewhat more
> complicated (depending on what you need to achieve).

Let´s say write my own interrupt to communicate as fast as possible
with a time sensitive hardware. I just wonder if a protected-mode
could make this problematic....

Time sensitive hardware usually goes for real-mode solutions or very
good drivers, or at least this is what I read.

> For ports, you can use in/out instructions and the special array
> port[] as supported by TP/BP (requires adding unit ports to uses
> clause).

I am already using them at this time =) ... just on TP 7

As the main part of the program is a Lazarus project it would be nice
to have Free Pascal compiling it.

> This will work if
> interrupt handler for the protected mode version is installed - e.g.
> protected mode version of interrupt 21h, i.e. DOS services, is
> probably installed for most DPMI servers as far as I remember
> correctly, but the same doesn't have to be true for other interrupts.
> Calling the real mode version is possibly e.g. using GO32.RealIntr
> (or SysRealIntr).

Interesting. What is DPMI?

> and you
> have to remember that this memory block is addressed different way
> while under real-mode (16-bit segment and offset must be passed to
> real-mode code) and when accessing it from protected-mode (32-bit
> flat address is used). Functions Global_Dos_Alloc and Global_Dos_Free
> provided in unit Go32 are your friends here.

thanks for the hints,

Felipe Monteiro de Carvalho

More information about the fpc-pascal mailing list