1

I am looking to convert GW BASIC/ QUICK BASIC programs to an auto executable files (exe) so I can run these programs on windows 7 pro 64bit/ windows 8 pro. But these programs prints from LPT1 port. I would like it to revert to USB as non of new computers come with LPT port.

considering a simple hello world progrm in Quick Basic.

 print  "Hello world"
 lprint "hello world"

I have googled a lot but not able to find a solution.

Yogesh R.L
  • 609
  • 7
  • 17
  • You have different possibilities, the easiest way is just to use an USB to Parallel adapter, second to write your own virtual parallel port driver or third to re-write the lprint routine to send the data out to an USB printer. – garzanti Dec 06 '12 at 12:43
  • What if 1)collect all the data that is going to be sent to LTP port by dumping the data into temp file. 2) Write a routine in other language to print data to usb port. 3) call this routine using shell command in QBASIC. – Yogesh R.L Dec 06 '12 at 13:37
  • Yes it's a good approach something like the shared memory concept. Another service/application could read from that file and print out to the USB/network printer. – garzanti Dec 06 '12 at 14:35
  • I am using libusb to communicate with usb port. but got stuck here. http://stackoverflow.com/questions/7050482/libusb-undefined-reference-to – Yogesh R.L Dec 07 '12 at 11:31

1 Answers1

2

As GWBASIC and QuickBASIC are DOS programs (16 bit), you won't be able to run them on any 64 bit Windows operating system, neither Windows 7 x64 nor Windows 8 x64. Moreover, as QuickBASIC only outputs 16 bit DOS executables, you also can't run your EXE files created with that.

You will have to use a third-party DOS emulator like DOSBOX: http://www.dosbox.com/

As an alternative, you could also set up a virtual machine running a Windows version, which is capable of executing 16 bit DOS EXE files, e.g. Windows 9x. You could use VMWare Player, Oracle VirtualBox, Windows VirtualPC, ... for that. But on the other hand, that might cause additional problems if you want to access your computer's (=host) hardware.

So my suggestion is to switch to FreeBASIC, which is open source software and available for Windows, Linux and DOS. You can easily port your old QBasic programs to FreeBASIC, often without much effort. Executables created by FreeBASIC can be run on 64 bit Windows versions. Using FreeBASIC's OPEN LPT command (see Wiki page of that command) you can access the printers configured in Windows, even those that are only virtual printers like, for example, PDF writers.

MrSnrub
  • 1,123
  • 1
  • 11
  • 19