call absolute()

 BBS: Inland Empire Archive
Date: 03-21-92 (03:29)             Number: 195
From: MICHAEL ORCHEKOWSKI          Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: call absolute()                Conf: (2) Quik_Bas
Does anyone know why QuickBASIC (and the interpreter) chokes on the CALL
ABSOLUTE () command? It seems every time I try to compile a program with
this command in it, I get a 'sub not found error' (#36 I believe). I
have also heard that there is an $INCLUDE file or .OBJ file that will
allow this to be done. I have the following routine:

'-------- Load the assembler program into an integer array --------

DEFINT D,I
DIM PROG1(312 / 2)

DEF SEG = VARSEG(PROG1(0))
FOR I = 0 TO 310
  READ D$
  D = VAL(D$)
  POKE I, D
NEXT
DEF SEG

DATA &H55,&H8B,&HEC,&H83,&HEC,&HE,&H53,&H51,&H6,&H57,&H56,&H8B,&H76,&H6
DATA &H8B,&H4,&H89,&H46,&HF2,&H8B,&H76,&H8,&H8B,&H4,&H89,&H46,&HF4,&H8B
DATA &H76,&HA,&H8B,&H4,&H89,&H46,&HF6,&H8B,&H76,&HC,&H8B,&H4,&H48,&H89
DATA &H46,&HF8,&H8B,&H76,&HE,&H8B,&H4,&H48,&H89,&H46,&HFA,&H8B,&H76,&H10
DATA &H8B,&H4,&H48,&H89,&H46,&HFC,&H8B,&H76,&H12,&H8B,&H4,&H48,&H89,&H46
DATA &HFE,&HBB,&H0,&HB0,&HB8,&H40,&H0,&H8E,&HC0,&H26,&HA1,&H10,&H0,&H25
DATA &H30,&H0,&H3D,&H30,&H0,&H74,&H3,&HBB,&H0,&HB8,&H8E,&HC3,&H8B,&H5E
DATA &HFE,&HB8,&HA0,&H0,&HF7,&HE3,&H8B,&H5E,&HFC,&HD1,&HE3,&H3,&HC3,&H8B
DATA &HF8,&H57,&H8B,&H46,&HF8,&H8B,&H5E,&HFC,&H2B,&HC3,&H40,&H8B,&HD8,&H53
DATA &H8B,&H46,&HFA,&H8B,&H56,&HFE,&H2B,&HC2,&H40,&H8B,&HC8,&H51,&HBA,&H0
DATA &H0,&H8A,&H66,&HF6,&HB0,&H20,&H83,&H7E,&HF4,&H0,&H74,&H5,&HB0,&HC4
DATA &HBA,&H1,&H0,&H51,&H8B,&HCB,&H83,&H7E,&HF4,&H0,&H74,&H8,&H50,&HB0
DATA &HB3,&HAB,&H83,&HE9,&H1,&H58,&HF3,&HAB,&H83,&H7E,&HF4,&H0,&H74,&H8
DATA &H50,&H83,&HEF,&H2,&HB0,&HB3,&HAB,&H58,&H83,&HFA,&H0,&H75,&HE,&H83
DATA &H7E,&HF2,&H0,&H74,&H8,&H50,&HB0,&H8,&H47,&HAA,&H4F,&H4F,&H58,&H2B
DATA &HFB,&H2B,&HFB,&H81,&HC7,&HA0,&H0,&H59,&HB0,&H20,&H83,&H7E,&HF4,&H0
DATA &H74,&H7,&H83,&HF9,&H2,&H75,&H2,&HB0,&HC4,&HBA,&H0,&H0,&HE2,&HAF
DATA &H83,&H7E,&HF2,&H0,&H74,&HB,&H8B,&HCB,&HB0,&H8,&H83,&HC7,&H2,&H47
DATA &HAA,&HE2,&HFC,&H83,&H7E,&HF4,&H0,&H74,&H27,&H59,&H5B,&H5F,&HB0,&HDA
DATA &HAB,&H3,&HFB,&H3,&HFB,&H83,&HEF,&H4,&HB0,&HBF,&HAB,&H50,&HB8,&HA0
DATA &H0,&H49,&HF7,&HE1,&H3,&HF8,&H58,&H83,&HEF,&H2,&HB0,&HD9,&HAB,&H2B
DATA &HFB,&H2B,&HFB,&HB0,&HC0,&HAB,&H5E,&H5F,&H7,&H59,&H5B,&H8B,&HE5,&H5D
DATA &HCA,&HE,&H0

This is then CALLed by the following syntax:

DEG SEG = VARSEG(PROG1(0))  'address of array holding routine
CALL ABSOLUTE(ULR, ULC, LRR, LRC, ATTR, FRAME, SHADOW, 0)
DEF SEG

<<< where >>>

ULR    = Upper Left Row
ULC    = Upper Left Column
LRR    = Lower Right Row
LRC    = Lower Right Column
ATTR   = Color Attributes (background*16+foreground)
FRAME  = Frame Flag   \__ 1=yes, 0=no
SHADOW = Shadow Flag  /

(This is a fast box-drawing routine included with the QBASIC Interpreter
Introductory Kit.)
--- RAMail 3.0
 * Origin: Old Pueblo BBS - Tucson Computer Society (1:300/2)
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