What QuickBASIC does....

 BBS: Inland Empire Archive
Date: 06-11-92 (14:17)             Number: 162
From: QUINN TYLER JACKSON          Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: What QuickBASIC does....       Conf: (2) Quik_Bas
Here is an assembler listing created by BC for a silly
little file.  It clearly shows how QuickBASIC pushes
parameters to the stack, in what order, and in what format.
 This should help any mixed language programmers out there.

By the way, has anyone had any luck linking A86 assembler
object files to QuickBASIC 4.5 object files?  I'd really
like to know...


Quinn

First, the QuickBASIC listing, then the assembler version as output by BC.
-----DECLARE SUB TestProcedure (A%, B$, C&)
DECLARE SUB donothing ()
TestInteger% = 15
TestString$ = "Test"
TestLong& = 12345678

CALL TestProcedure(TestInteger%, TestString$, TestLong&)

SUB donothing

END SUB

SUB TestProcedure (A%, B$, C&)
CALL donothing
END SUB

ASSEMBLER VERSION----

Offset  Data    Source Line   Microsoft (R) QuickBASIC Compiler Version 4.50

 0030   0006    DECLARE SUB TestProcedure (A%, B$, C&)
 0030   0006    DECLARE SUB donothing ()
 0030   0006    TestInteger% = 15
 0030   0006    TestString$ = "Test"
 0030   0006    TestLong& = 12345678
 0030   0006
 0030   0006    CALL TestProcedure(TestInteger%, TestString$, TestLong&)
 0030    **            I00002: mov   TESTINTEGER%,000Fh
 0036    **                    mov   ax,offset <const>
 0039    **                    push  ax
 003A    **                    mov   ax,offset TESTSTRING$
 003D    **                    push  ax
 003E    **                    call  B$SASS
 0043    **                    mov   TESTLONG&,614Eh
 0049    **                    mov   TESTLONG&+0002h,00BCh
 004F    **                    mov   ax,offset TESTINTEGER%
 0052    **                    push  ax
 0053    **                    mov   ax,offset TESTSTRING$
 0056    **                    push  ax
 0057    **                    mov   ax,offset TESTLONG&
 005A    **                    push  ax
 005B    **                    call  TESTPROCEDURE
 0060   0010
 0060   0010    SUB donothing
 0060    **                    jmp   I00003
 0063    **            DONOTHING:
 0063    **                    mov   cx,0000h
 0066    **                    call  B$ENRA
 006B   0010
 006B   0010    END SUB
 006B    **            I00004: call  B$EXSA
 0070    **                    ret   0000h
 0073   0010
 0073   0010    SUB TestProcedure (A%, B$, C&)
 0073    **            I00003: jmp   I00005
 0076    **            TESTPROCEDURE:
 0076    **                    mov   cx,0000h
 0079    **                    call  B$ENRA
 007E   0010    CALL donothing
 007E    **                    call  DONOTHING
 0083   0010    END SUB
 0083    **            I00006: call  B$EXSA
 0088    **                    ret   0006h
 008B   0010
 008B   0010
 008B    **            I00005: call  B$CENP
 0090   0010


--- Maximus 2.01wb
 * Origin: VKUG/VPCC QuickBasic Echo - Richmond, BC (1:153/151)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET