Link to home
Start Free TrialLog in
Avatar of Raid
Raid

asked on

Dpmi Memory in Turbo Pascal 7.0

Is there any unit, or any code that allows me to use DPMI memory or Protected Mode Memory in Turbo Pascal 7.0.
I know it's a 16bit Compiler, but I'm sure there are ways of using DPMI memory or Protected Mode Memory in a 16bit mode.  I am very familiar of using assembly language, so if you give me code, can you also include info on being able to use assembly language in the same way in the DPMI mode.
Avatar of nrico
nrico

Sure you can switch to DPMI mode using assembler, but you'll have to do _ALL_ the work yourself, including address spacing, switching back for DOS calls, so you'd be coding almost *everyting* in assembler (I don't think you'd want that). My advice: Get a DPMI compiler.
I believe the Free Pascal Compiler (http://pascal.about.com/ should give you a link) is 32-bit, though I'm not sure.

If you now C, DJGPP is another good alternative (http://www.delorie.com/).
(I mean "know" - sorry)
Ofcourse you can always change target to protected before you compile the program... That would take you in and out of protected mode... But pascal the pascal code you'll use in this mode will not be fast... (most because of it's a 16bit compile) But you can always use assembler... and since you're familiar with that I guess you could get both memory and speed.

I'll put together an example for you...  (if you don't mind)

But if you want to write more advanced 32 bit programs for DOS mode programs you should defenetly go with a better Pascal compiler... (such as the Free Pascal Compiler) wich nrico suggests...
.. the reson for that is that in Borland Pascal 7.0 the protected mode is a 286 compatibel 16bit protected mode. But because of that: Most of your assembler procedures/Functions will still work as long as you don't assign new values to DS/CS/ES... Ofcourse, you can still use them in this protected mode, but they have to be valid... For instance: common asm instructions in a real mode code that uses graphic would be
"
MOV AX,$A000
MOV ES,AX
" (will most probably cause a runtime error)
Insted you should use the pascal's builtin value SegA000 for protected mode adressing like the one above.

"
MOV AX,SegA000
MOV ES,AX
" (will not cause a runtime error)

When you program in protectedmode you have to think on things like this! Cause if you don't... program will not work.
Avatar of Raid

ASKER

Message to Hypo, Sorry, I do not have Borland Pascal 7.0, I have Turbo Pascal 7.0 which can not turn to DPMI mode.
If you have Borland Pascal 7.0, Can I PLEASE have it, It would help ALOT!!!
yes there is a way.  Both Borland and Turbo can usde DPMI modes I have a unit somewhere aorund that can do it in Turbo Pascal.  As soon as I find it I'll send it over...
In Q_10258422 ( Pascal to C converter ) Curri placed internet address www.freepascal.org/ . There is free pascal compiler which works in protected mode and have the syntax compatible with Pascal 7.0.
Avatar of Raid

ASKER

Kamarey, I've downloaded those before and I don't know how to use them.  I've downloaded TMT pascal, and FPK Pascal but no luck.  If you can give me knowledge on how to use them, that would be very useful.  And VibesPro, that would help alot as well.
ASKER CERTIFIED SOLUTION
Avatar of sumant032199
sumant032199
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial