Author Topic: mixed language programming  (Read 2813 times)

0 Members and 1 Guest are viewing this topic.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
mixed language programming
« on: October 26, 2020, 02:52:19 am »
I make extensive use of the DOS interrupts in my Quick Basic programs.

I use the  CALL keyword to make calls to A86 assembler.

For an example of "DOS interrupts"  see here:
http://www.ctyme.com/intr/int-21.htm

Question:  Will QB64 be able to compile my Quick Basic source code properly?

For those of you who don't know it, the "DOS interrupts" were renamed to the "WINDOWS API"
I like "DOS interrupts" better. Things like opening and closing a file or moving a file pointer are easily done with the interrupts. 

« Last Edit: October 26, 2020, 03:00:46 am by NOVARSEG »

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: mixed language programming
« Reply #1 on: October 26, 2020, 09:46:58 am »
With extremely limited exceptions regarding mouse access, no, QB64 does not support embedded 16 bit real mode assembly or any DOS interrupt facilities.

You will need to adapt your programs to use plain BASIC commands, though you may be able to benefit from QB64's extensions.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: mixed language programming
« Reply #2 on: October 26, 2020, 10:16:44 am »
I have quite a bit of experience with Windows API so if your code taps into that I'm sure it can be adapted (provided I can tell what is going on)
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: mixed language programming
« Reply #3 on: October 26, 2020, 11:03:36 pm »
Hi Luke
Hi SpriggsySpriggs

OK  The DOS interrupts  make Quick Basic 4.5 extremely useful.

Heres the thing - if you run XP  operating system the 16 bit DOS programs
will run just fine even the DOS interrupts are handled properly.  Somehow the OS recognizes the program is 16 bit.   If the program is 16 bit the OS switches to VM mode.
OK see here a good article on virtual 86 mode.
https://en.wikipedia.org/wiki/Virtual_8086_mode

Notice that  VM mode is hardware virtualization mode because the 386 CPU has a VM bit