Re: DRL updated! -- please stop that INT discussion! Really!

Aitor Santamaria Merino <[email protected]>
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Eric Auer wrote:

>Hi, okay.
>Some compiler may not have msdos(), and you cannot have inline assembly
>in protected mode unchanged from real mode, you have to rewrite it. True.
>
The FreePascal Compiler gives you a DOS Unit 90% compatible with that of 
TP, and does for you all the dirty job of using DPMI for calling 
realmode ints and interfacing with "realmode memory".
The only unsupported stuff respect to TurboPascal is inline() (I think), 
the reserved modified word "FAR" in order to declare a procedure FAR, 
and the fact that the functions CSeg, DSeg and SSeg actually return 
always 0.

For the rest of the stuff, you can compile the program as normally, and 
you would have a full DPMI-based 32-bit program, or a Win32 based one, 
or a Linux, FreeBSD, BeOS, etc (DOS unit is present for them all, I think).
You can even return ANY data type, and you can also use the function 
name as variable, and you can compile Delphi-style code for ALL 
platforms. This all is new to FPC.

>BUT:
>I am not planning to ever have a protected mode DRL version.
>
Not that it is difficult ;-)
(nor I meant I want it)

>I have removed an "upcase string" assembly code function that even would have
>  required me to have tasm.
>
For FPC you would add {$ASMMODE INTEL} for introducing Intel-style 
assembler.

>The only inlined "int 16" is in the single "get key" function.
>
Crt is no longer a restriction in FPC.

>The MsDos() calls can be easily replaced by any other mechanism that
>    your compiler has for calling int 21, including intr($21,...) with
>    a simple search and replace.
>
>If you want to do any further porting, you need to:
>Port set color (single function) if ANSI is unavailable.
>Port get key if an inlined "int 16" does not make you happy and/or you
>   cannot reach $40:[...] directly. I recommend using a library function,
>   but to do me and Ralf a favour, I had removed the use of CRT so the
>   built-in function was unavailable. There are lots of ways to have other
>   get key mechanisms, including ones that use intr().
>
These two would be easy using Intr()

>Port any parts of the DOS library (dos.tpu or something) that are used, like
>   findfirst / findnext. I mean, replace their use by the use of other
>   functions that are available in your compiler.
>
This is done for FPC.

Aitor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.