The point is that that things are a little different under the hood in Protected Mode (32-bit Windows), and programs that are being ported from oine platform to another may need a little tinkering to get them going.
One of the primary tasks of Protected mode is system security and stability. Onme way it achieves this is to prevent ring-3 code (ie, program code or application level code) from directly access memory addresses below 1Mb (or any memory that is not allocated to the process) -- to try to do so causes a Page Fault (GPF).
Similarly, 32-bit Windows apps cannot make INT calls to the DOS/BIOS routines as they are designed to work in real-mode. Therefore, attempting to call a DOS/BIOS interrupt will gain you one GPF point for each attempt.
However, it's not a case of doom and gloom at all as much of that functionality is either provided by PowerBASIC for Windows (PB/Win) and the PowerBASIC Console Compiler (PB/CC) or through the Windows API "library" of functions.
For example, DOS BASIC code that makes use of interrupts tends to do that so it can utilize DOS/BIOS functions such as low-level com port I/O, getting the DTA block from the file system to identify the excutables home path, etc, can be easily replaced with fairly simple BASIC statements, etc.
Finally, a word of friendly advice:
At first glance, the Windows API "library" can seem confusing vast. If/When you get to that point, the most important things to remember is that:[list=a][*] If your DOS BASIC code uses standard BASIC statements and functions (no graphics, and no inline assembler, etc), then it is likely that the conversion to PB/CC will be fairly effortless.
[*] PowerBASIC and the Windows API functions offer 32-bit replacements for the vast majority of interrupt services that DOS BASIC code would use.
[*] The Windows API is really a "free" programmers utility library (it just happens to be a a very big library with many thousands of functions).
[*] Calling Windows API functions is no different to calling Subs/Functions in your own code. The "trick" is passing the correct parameters, exactly like it is when calling your own Subs/Functions.
[*] You don't have to learn the entire API to write PB/CC code, nor do you need to learn it all at once!

[*] If you get stuck, there are loads of PB/CC programmers hanging out here to help you... and the occasional staff member or two help out where we can too!

Trust me on this: once you get used to PB/CC and Windows, you'll never want to go back to the confines of 640K ever again!!!
IOW, making the move from DOS to PB/CC can be a life-changing event! If you've not done it yet, you simply don't know what you are missing out on...!

------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment: