No announcement yet.

Migration from PB/DOS to PB/CC

  • Filter
  • Time
  • Show
Clear All
new posts

    Migration from PB/DOS to PB/CC

    Can any one tell me How to convert a PB/DOS 3.2 program to PB/CC.
    What about libraries used in PB3.2 Will it work? And functions and command
    like CVMS,COM, PRINT USING, CHAIN, INPUT are some of them.



    CHAIN, INPUT etc. are no longer supported on PBCC. See the following link for the differences.]



    You can either complain that rose bushes have thorns- or rejoice that thorn bushes have roses!

    [This message has been edited by Douglas C. Horner (edited November 07, 2003).]
    There is a principle which is a bar against all information, which is proof against all arguments and which cannot fail to keep a man in everlasting ignorance - that principle is contempt prior to investigation.

    Herbert Spencer


      As noted in the link, CALL INTERRUPT is not supported. This has
      and is continuing to cause me grief. I use(d) CALL INTERRUPT
      extensively in PB/DOS and developing work-arounds is very time

      Otherwise, I like PB/CC. The syntax is almost identical to PB/DOS
      with a few tweeks here and there and would recommend its continued

      Other notes: One of the big advantages CC has over DOS is that
      you are limited to file sizes only by the amount of hard drive
      real estate you have available. For example, if you have a file
      you need to get into memory and it happens to be 500K big, no
      Open "SomeFile.txt" for binary as #1
         get$ $1,lof(1),temp$
            close #1
      It really doesn't matter what LOF(1) happens to be. If it's too
      big for RAM memory, CC will set up a windows swap file and put
      the remainder on your hard drive as if it's in RAM memory.

      CC has other big advantages over DOS but I'll let other people
      extoll vurtues they think is really neat.

      [This message has been edited by Mel Bishop (edited November 07, 2003).]
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.


        Thanks Doug
        For your very quick reply.
        I went that link, before posting. So, What could be the solution.
        Is there any libraries, available for PB/CC to substitute?
        What could be the solution.
        Thanks Mel,
        I can ask the same thing to you as well.
        Thanks for your very quick reply
        Originally posted by San Gustov:
        Can any one tell me How to convert a PB/DOS 3.2 program to PB/CC.
        What about libraries used in PB3.2 Will it work? And functions and command
        like CVMS,COM, PRINT USING, CHAIN, INPUT are some of them.





          PB/CC compiles to Windows programs, not DOS. That means that,
          instead of using "libraries", like PB/DOS can, it uses DLL's,
          like any Windows program. No, you cannot use your PB/DOS libraries
          with PB/CC.

          PB/CC cannot create DLL's. The PB/Win compiler can. However, EXE's
          compiled with PB/CC can use DLL's.

          If you have more questions, feel free to ask. The poeple in these
          Forums are very helpful.



            There are multitudes of library files available. There are
            hundreds of not thousands of functions available. Some, but
            not all, are automatically installed when you install PB/CC.

            I guess the most common would be WIN32API.INC but don't ask me
            what all the function in this file would be.

            It would be interesting if someone would post a link to somewhere
            listing all the functions available in all the .INC files.
            (wishful thinking on my part).

            There are no atheists in a fox hole or the morning of a math test.
            If my flag offends you, I'll help you pack.


              CALL INTERRUPT is not supported...developing work-arounds is very time consuming.
              What you are developing are not "workarounds."

              Those are "modifications necessitated by a change of the operating system on which the application is to execute."

              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]


                That is quite correct, Michael.

                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! In fact you probably wont need to know any to get started with PB/CC!
                [*] 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! [/list=a]
                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...!

                PowerBASIC Support
                mailto:[email protected][email protected]</A>
                mailto:[email protected]