TP to FP port 
Author Message
 TP to FP port

The other day i tried to get a really large legacy Turbo Pascal app to
run under Windows, so I got FreePascal. Lo and behold, after tweaking
the Pointer size everywhere it actually works, right down to the
ugly assembler blocks for reprogramming the text mode fonts that some
geek[0] threw into it.

The *only* thing that doesn't work is accessing those BIOS interrupts
that require pointers passed as segment/offset pairs in two registers.
Having heard vague rumours about the different adressing model of
protected mode, I suppose that shouldn't surprise me. But since I got
very close to getting the thing to run 100% with almost no effort,
after all this time, I'd really like to make the port perfect. Should
I read up on DPMI, or use the nifty BIOS graphics tweaking unit that
some kind soul or other has already done, or program around those very
few interrupts, or just leave well enough alone?

[0] Well, if you must know, actually me, eight years previous.



Mon, 07 Apr 2003 03:00:00 GMT  
 TP to FP port

Quote:

> The *only* thing that doesn't work is accessing those BIOS interrupts
> that require pointers passed as segment/offset pairs in two registers.

You will have to use the go32 unit. Have a look at the docs (units
manual) for the functions
Global_Dos_Alloc/Global_Dos_Free/DosMemPut/DosMemGet. You will have to
allocate a block of memory below the 1MB border using the first
function, possibly put the desired data in the block using the third
one, call the interrupt, get any return values using the fourth
procedure and free the block again with the second.

Jonas



Mon, 07 Apr 2003 03:00:00 GMT  
 TP to FP port

Quote:


>> The *only* thing that doesn't work is accessing those BIOS interrupts
>> that require pointers passed as segment/offset pairs in two registers.

>You will have to use the go32 unit. Have a look at the docs (units
>manual) for the functions
>Global_Dos_Alloc/Global_Dos_Free/DosMemPut/DosMemGet. You will have to
>allocate a block of memory below the 1MB border using the first
>function, possibly put the desired data in the block using the third
>one, call the interrupt, get any return values using the fourth
>procedure and free the block again with the second.

My hint is to get the go32v2 RTL sources, specially the DOS unit from the
go32v2 target. It is stuffed with examples of this kind.

Probably the manual also has good examples (for the procedures named by
Jonas above).



Mon, 07 Apr 2003 03:00:00 GMT  
 TP to FP port

Quote:



>> The *only* thing that doesn't work is accessing those BIOS interrupts
>> that require pointers passed as segment/offset pairs in two registers.
> You will have to use the go32 unit. Have a look at the docs (units
> manual) for the functions
> Global_Dos_Alloc/Global_Dos_Free/DosMemPut/DosMemGet. You will have to
> allocate a block of memory below the 1MB border using the first
> function, possibly put the desired data in the block using the third
> one, call the interrupt, get any return values using the fourth
> procedure and free the block again with the second.
> Jonas

Hooray!  That did it!  Hmmm, I might actually start working on that
thing again...


Tue, 08 Apr 2003 13:55:13 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Porting from TP for DOS 5.0 to TP for windows 1.5

2. Help in porting from TP to FPC...

3. help in porting from TP to FPC...

4. Com ports in TP 7.0

5. Com ports in TP 7.0

6. porting from TP to C++

7. Porting BP/TP 7.0 programs to Windows 3.X/95/NT

8. help about accessing the i/o ports (TP 6.0)

9. TP 1.5 for Windows and Comm Ports

10. Using the parallel PC port for input within TP 3.0

11. The best COM port routines for TP - async.zip (1/2)

12. Question: (FPC): is the FP.EXE in de WIN32 different than the FP.EXE in the GO32V2 dir?

 

 
Powered by phpBB® Forum Software