QBasic -> EXE 
Author Message
 QBasic -> EXE

I have been told that QBasic actually does compile.  It compiles your
code to memory and then executes it, rather than being strictly an
interpreter like GWBASIC.  This would make sense, considering that
QBasic is pretty much a crippled edition of Quick Basic.  Perhaps the
code to compile to disk is even still in it, albeit disabled.

If this is true, then it should be possible to develop a hack for QBasic
to re-enable the compile to disk capability, or at least dump the
compiled code out to a disk file and then tack an .OBJ or .EXE header
onto it.  

Any comments on this possibility?

John Morrison



Fri, 31 Mar 2000 03:00:00 GMT  
 QBasic -> EXE

Hullo.

Quote:

> I have been told that QBasic actually does compile.  It compiles your
> code to memory and then executes it, rather than being strictly an
> interpreter like GWBASIC.  This would make sense, considering that
> QBasic is pretty much a crippled edition of Quick Basic.  Perhaps the
> code to compile to disk is even still in it, albeit disabled.

> If this is true, then it should be possible to develop a hack for QBasic
> to re-enable the compile to disk capability, or at least dump the
> compiled code out to a disk file and then tack an .OBJ or .EXE header
> onto it.

> Any comments on this possibility?

I'm not too sure (sorry 'n' all) but clearly QB must convert the code
into machine code in order to run it (as BASIC is just a representation
that we mere humans can understand easily :)

I got very confused by the last bit of the first paragraph and the first
bit of the second :-o
I think what you are saying is that once QB has compiled a program into
memory to run it, it hangs around in there. The hack would then find
this and save it to disk.
Personally, I have no idea where to even start looking. It probably
clears out the code after running it anyway (it should do) to keep the
system running efficiently.

Laz.



Fri, 31 Mar 2000 03:00:00 GMT  
 QBasic -> EXE

I think QBasic turn the code into Machine Code then runs it.

--
Ken

QBasic Page: http://www.geocities.com/SiliconValley/Heights/8433/



t>...

Quote:
> I have been told that QBasic actually does compile.  It compiles your
> code to memory and then executes it, rather than being strictly an
> interpreter like GWBASIC.  This would make sense, considering that
> QBasic is pretty much a crippled edition of Quick Basic.  Perhaps the
> code to compile to disk is even still in it, albeit disabled.

> If this is true, then it should be possible to develop a hack for QBasic
> to re-enable the compile to disk capability, or at least dump the
> compiled code out to a disk file and then tack an .OBJ or .EXE header
> onto it.  

> Any comments on this possibility?

> John Morrison



Fri, 31 Mar 2000 03:00:00 GMT  
 QBasic -> EXE


                <  snip  >

Quote:
> I think what you are saying is that once QB has compiled a program into
> memory to run it, it hangs around in there. The hack would then find
> this and save it to disk.
> Personally, I have no idea where to even start looking. It probably
> clears out the code after running it anyway (it should do) to keep the
> system running efficiently.

Aye.  The idea would be to either patch QBASIC.EXE itself to provide a way
to hotkey into a mem dump routine, or to write a TSR that could do it
while your QBasic program was running.  It would figure out the proper
offsets and everything to create an .OBJ header and tack it on to the
beginning of the file before dumping the memory image to it.

The difficulties would of course be significant, but I'm sure there are a
few assembler Gurus out there who could do it.  The benefits go without
saying.

The possibility does exist that Microsoft rigged it somehow to totally
scramble the code so that it couldn't be dumped.  That wouldn't surprise
me a bit.

John Morrison



Fri, 31 Mar 2000 03:00:00 GMT  
 QBasic -> EXE


Quote:
> Hullo.


> > I have been told that QBasic actually does compile.  It compiles your
> > code to memory and then executes it, rather than being strictly an
> > interpreter like GWBASIC.  This would make sense, considering that
> > QBasic is pretty much a crippled edition of Quick Basic.  Perhaps the
> > code to compile to disk is even still in it, albeit disabled.

> > If this is true, then it should be possible to develop a hack for
QBasic
> > to re-enable the compile to disk capability, or at least dump the
> > compiled code out to a disk file and then tack an .OBJ or .EXE header
> > onto it.

> > Any comments on this possibility?

> I'm not too sure (sorry 'n' all) but clearly QB must convert the code
> into machine code in order to run it (as BASIC is just a representation
> that we mere humans can understand easily :)

Neither QBASIC nor QuickBasic compile to true machine code in memory.  They
compile to what is called 'threaded p-code'.  Regular p-code (pseudo code)
is an idealized machine code, tailored to the language being interpreted.
But threaded p-code, instead of instruction 'op codes', uses actual calls
to the routines in the interpreter which perform the instruction.  In a
sense, the p-code is actually 'executed', but it is essentially a series of
subroutine calls, each followed by its operands.  This is much faster than
normal p-code interpretation and was touted by Microsoft when implemented
in QB (4.0, if I remember correctly).  But the p-code would be useless
without the interpreter.  Unlike regular p-code, threaded p-code couldn't
be easily compiled to EXE outside the interpreter, because the 'op codes'
mean nothing without knowing what the routines at the referenced addresses
do.

Creating an EXE file is a different process, and others have described that
in this thread.
--
Judson McClendon          This is a faithful saying and worthy of all
Sun Valley Systems        acceptance, that Christ Jesus came into the

(please remove zzz from email id to respond)



Sat, 01 Apr 2000 03:00:00 GMT  
 QBasic -> EXE


Quote:

> > Neither QBASIC nor QuickBasic compile to true machine code in memory.
> > They compile to what is called 'threaded p-code'.  Regular p-code
> > (pseudo code)

> > Creating an EXE file is a different process, and others have described
> > that in this thread.

> So what you are saying, in a nutshell, is that QB compiles to
> P-Code in memory, and straight machine code in an .EXE?

Pretty much (threaded p-code, anyway), except for a minor detail.  To get
an EXE file QuickBasic (not QBasic) actually generates an OBJ file on disk
which is input to LINK.EXE which links in other support OBJ files and
actually produces the final EXE file.
--
Judson McClendon          This is a faithful saying and worthy of all
Sun Valley Systems        acceptance, that Christ Jesus came into the

(please remove zzz from email id to respond)


Sat, 01 Apr 2000 03:00:00 GMT  
 QBasic -> EXE



Quote:

> Neither QBASIC nor QuickBasic compile to true machine code in memory.
They
> compile to what is called 'threaded p-code'.  Regular p-code (pseudo
code)

> Creating an EXE file is a different process, and others have described
that
> in this thread.

So what you are saying, in a nutshell, is that QB compiles to
P-Code in memory, and straight machine code in an .EXE?

John Morrison



Sat, 01 Apr 2000 03:00:00 GMT  
 QBasic -> EXE

Quote:

> Neither QBASIC nor QuickBasic compile to true machine code in memory.  They
> compile to what is called 'threaded p-code'.  Regular p-code (pseudo code)
> is an idealized machine code, tailored to the language being interpreted.
> But threaded p-code, instead of instruction 'op codes', uses actual calls
> to the routines in the interpreter which perform the instruction.  In a
> sense, the p-code is actually 'executed', but it is essentially a series of
> subroutine calls, each followed by its operands.  This is much faster than
> normal p-code interpretation and was touted by Microsoft when implemented
> in QB (4.0, if I remember correctly).  But the p-code would be useless
> without the interpreter.  Unlike regular p-code, threaded p-code couldn't
> be easily compiled to EXE outside the interpreter, because the 'op codes'
> mean nothing without knowing what the routines at the referenced addresses
> do.

Coincidentally (unless you're a fatist?) I found out about something to
do with this. Something about if you edit a compiled QB program, you can
see all the QB error codes and what-have-you. This would explain why QB
.exe's are so F'ing big :)

Laz.



Sat, 01 Apr 2000 03:00:00 GMT  
 QBasic -> EXE

Quote:
>I have been told that QBasic actually does compile.  It compiles your
>code to memory and then executes it, rather than being strictly an
>interpreter like GWBASIC.  This would make sense, considering that
>QBasic is pretty much a crippled edition of Quick Basic.  Perhaps the
>code to compile to disk is even still in it, albeit disabled.

>If this is true, then it should be possible to develop a hack for QBasic
>to re-enable the compile to disk capability, or at least dump the
>compiled code out to a disk file and then tack an .OBJ or .EXE header
>onto it.  

>Any comments on this possibility?

>John Morrison

check the size of the two files if QuickBasic is bigger than Qbasic (I'm 99%
 sure it is) then a hack won't work.


Sat, 08 Apr 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. QBasic -> EXE

2. QBasic -> EXE

3. QBasic ->VBasic ->file.exe

4. QBASIC --> EXE?

5. new user-->>>How can i use existing exe's in vb

6. Wanted >>QBasic Tips For Notebook Page on Kenneth Green's Homepage

7. How to pass a value from EXE -->IE50 container -->ActiveX Document

8. Application Setup Wizard Says D:\<path>\D:\<path>\target.exe

9. How to pass a value from EXE -->IE50 container -->ActiveX Document

10. *<< Making EXE File >>*

11. using The Shell Command >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

12. <<<<<<<<ComboBox>>>>>>>>>>>>

 

 
Powered by phpBB® Forum Software