PROBLEM WITH 'CALL ABSOLUTE'

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
User avatar
varshney_sp
Newbie
Posts:3
Joined:Mon May 03, 2004 3:07 am
Location:India
PROBLEM WITH 'CALL ABSOLUTE'

Post by varshney_sp » Mon May 03, 2004 4:20 am

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)
Sandy

Guest

Re: PROBLEM WITH 'CALL ABSOLUTE'

Post by Guest » Sat May 08, 2004 11:55 am

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

'$INCLUDE: 'QB.BI'
;)

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)
'

User avatar
varshney_sp
Newbie
Posts:3
Joined:Mon May 03, 2004 3:07 am
Location:India

Re: PROBLEM WITH 'CALL ABSOLUTE'

Post by varshney_sp » Sun May 09, 2004 2:18 am

::)Hello Dr_D

:DThanks for your response.

:-[ I tried what you said but the result is same, what to do now? Please tell me.
Sandy

Guest

Re: PROBLEM WITH 'CALL ABSOLUTE'

Post by Guest » Sun May 09, 2004 10:05 am

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?

Patz2009
Newbie
Posts:3
Joined:Thu Jun 23, 2005 10:50 pm

Post by Patz2009 » Fri Jun 24, 2005 12:01 am

The file works, but the forums added

Code: Select all

&nsbp;
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.

Guest

Post by Guest » Tue Jun 28, 2005 6:41 pm

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

Post Reply