Page 1 of 1
PROBLEM WITH 'CALL ABSOLUTE'
Posted: Mon May 03, 2004 4:20 am
by varshney_sp
Friends, I'm using quick basic 4.5 and I have a problem with running assembly procedures. Whenever I use CALL ABSOLUTE statements the compilers flags an error message "SUB PROGRAM NOT DEFINED".
The same program perfectly runs in the qbasic 1.1 compiler provided with MS-DOS 6.22
While going through the Online quick basic help I found instructions related to the use of CALL ABSOLUTE statement. According to it, qb should use qb.qlb as the default library ( and is using off course!) and I should properly link my program to the appropriate library, but I don't know how to link my program to libraries and also I don't know which library to link.
The problem remain same when I run the program in Quick Basic Extended which I downloaded from this site.
I'm new to basic programming :-[ please help.
Also tell me that does Quick Basic Extended version provided on this site is the same what is called Quick Basic 7.1 ( this compiler was listed under the name of Quick Basic 7.1)
Re: PROBLEM WITH 'CALL ABSOLUTE'
Posted: Sat May 08, 2004 11:55 am
by Guest
You need to include the QB.BI file also. Copy the code from the bottom of this post, paste it into Notepad and save it in your QB directory as QB.BI.
Then at the beginning of your program, add this line.
Code: Select all
'***
' QB.BI - Assembly Support Include File
'
'Copyright (C) 1987 Microsoft Corporation
'
' Purpose:
' This include file defines the types and gives the DECLARE
' statements for the assembly language routines ABSOLUTE,
' NTERRUPT, INTERRUPTX, INT86OLD, and INT86XOLD.
'
'***************************************************************************
'
' Define the type needed for INTERRUPT
'
TYPE RegType
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
flags AS INTEGER
END TYPE
'
' Define the type needed for INTERUPTX
'
TYPE RegTypeX
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
AS INTEGER
flags AS INTEGER
AS INTEGER
AS INTEGER
END TYPE
'
' DECLARE statements for the 5 routines
' -------------------------------------
'
' Generate a software interrupt, loading all but the segment registers
'
DECLARE SUB INTERRUPT (intnum AS INTEGER,inreg AS RegType,outreg AS RegType)
'
' Generate a software interrupt, loading all registers
'
DECLARE SUB INTERRUPTX (intnum AS INTEGER,inreg AS RegTypeX, outreg AS RegTypeX)
'
' Call a routine at an absolute address.
' NOTE: If the routine called takes parameters, then they will have to
' be added to this declare statement before the parameter given.
'
DECLARE SUB ABSOLUTE (address AS INTEGER)
'
' Generate a software interrupt, loading all but the segment registers
' (old version)
'
DECLARE SUB INT86OLD (intnum AS INTEGER,_inarray(1) AS INTEGER,_outarray(1) AS INTEGER)
'
' Gemerate a software interrupt, loading all the registers
' old version)
'
DECLARE SUB INT86XOLD (intnum AS INTEGER,_ inarray(1) AS INTEGER,_outarray(1) AS INTEGER)
'
Re: PROBLEM WITH 'CALL ABSOLUTE'
Posted: Sun May 09, 2004 2:18 am
by varshney_sp
::)Hello Dr_D
:DThanks for your response.
:-[ I tried what you said but the result is same, what to do now? Please tell me.
Re: PROBLEM WITH 'CALL ABSOLUTE'
Posted: Sun May 09, 2004 10:05 am
by Guest
Can you post one of the lines that your using CALL ABSOLUTE on? Maybe it's just a simple syntax error...
One more thing...
Are you compiling from the command line or the IDE?
If your compiling from the IDE, will the program run without compiling?
Posted: Fri Jun 24, 2005 12:01 am
by Patz2009
The file works, but the forums added
to each of the lines, which is HTML for a user-defined space. Get rid of all those and follow his instructions. It should run correctly from there.
Posted: Tue Jun 28, 2005 6:41 pm
by Guest
You've probably worked it out by now , but anyway I had a similar problem. The cause was I had not reset the seg offset. So putting DEF SEG = 0 after the CALL ABSOLUTE sorted the problem