What do I need to do if I get an error in QBasic saying

call absolute

and it doesn't work - or something like that. I don't have absolute to call?!? This is when I have been looking at other peoples code and then trying to run them. Help!
Thanks,
TP :o

Dani AI

Generated

Brief diagnostic and a safe checklist that expands on ’s pointers and gives concrete next steps for the error saw.

CALL ABSOLUTE is the BASIC statement that transfers control to machine-language code; a program that uses it either expects QuickBASIC’s extra library support or expects raw machine-code bytes to have been placed in memory first. Two distinct failure modes are common: (a) the QuickBASIC environment was not started with the Quick Library that supplies some CALL/INTERRUPT helpers, or (b) the program expects an in-memory ML routine but the segment/offset or bytes were not prepared correctly. (qbasic.com)

Practical steps to make an in-memory CALL ABSOLUTE work (what to check and in what order):

  1. Confirm whether the source is written for QuickBASIC (compiled IDE) or for QBasic (interpreter).
  2. If the code contains assembly bytes or DATA blocks that are meant to become a routine, allocate a buffer (an array), set BASIC’s data segment to that buffer, get the buffer offset, POKE the bytes into memory, then call the routine at that offset. Use VARPTR/VARSEG and DEF SEG to get and set addresses correctly; DEF SEG uses segment values (shifted) so use VARSEG/VARPTR immediately before POKE/CALL to avoid relocation issues. A minimal skeleton follows for clarity (adapt sizes/types to the source program):
DIM asmBuf(1 TO n) AS INTEGER
DEF SEG = VARSEG(asmBuf(1))
offset = VARPTR(asmBuf(1))
' POKE machine-code bytes to (offset + i)
CALL ABSOLUTE(offset)
DEF SEG

Refer to the VARPTR/DEF SEG behavior and CALL ABSOLUTE semantics when translating bytes to memory. (qbasic.com)

Troubleshooting and modern options:

  • If QuickBASIC complains that ABSOLUTE is unavailable, start QB with the /L switch to load the Quick library (or supply the appropriate .QLB). If the program uses interrupts or low-level I/O, remember many of those calls assume real‑mode DOS behavior. ()
  • For running or developing these old programs on modern machines, prefer QB64 (implements legacy CALL/INTERRUPT semantics and runs on Windows/Linux/macOS) or run the original QB/QBASIC under DOSBox; both approaches avoid many environment mismatches. Be aware QB64 emulates registers and has some INT limitations. (qb64.com)

If the original source is available, the specific DATA/POKE/DEF SEG sequence or the startup command used to launch QB/QB64 will usually show which path (library vs in-memory ML) is required.

Recommended Answers

All 2 Replies

what was the code that caused the error? post it and we will try and help!

If you are using QB (QuickBasic), so often wrongly called Qbasic, then
Call Absolute (as well as Call Interrupt) are in the QB library QB.QLB

In that case, start QB with QB /L libraryname
(no library name is required for QB.QLB as it is the default)

If you are, in fact, using QBasic then Call absolute is there for you if you
use it correctly. The Assembly code needs to be in memory (stored in an
array is the easiest way) then use the array as the parameter for call absolute.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.