First post, by Peter Swinkels
I am trying to use int 21h, 4bh to launch programs from a Quick Basic program. It only works from inside a compiled program for me. When executed from the run-time environment the function always claims there isn't enough memory (ax = 8h). I know for a fact that in most cases this can't be true, because when I use the SHELL statement instead it usually works fine.
My code:
DEFINT A-Z
TYPE RegTypeX
ax AS INTEGER
bx AS INTEGER
cx AS INTEGER
dx AS INTEGER
bp AS INTEGER
si AS INTEGER
di AS INTEGER
flags AS INTEGER
ds AS INTEGER
es AS INTEGER
END TYPE
DECLARE SUB INTERRUPTX (intnum AS INTEGER, inreg AS RegTypeX, outreg AS RegTypeX)
DIM Program AS STRING
DIM Registers AS RegTypeX
CLS
Program = "z:\mem.com" + CHR$(0)
Registers.ax = &H4B00
Registers.ds = VARSEG(Program)
Registers.dx = SADD(Program)
INTERRUPTX &H21, Registers, Registers
PRINT "Return code: "; Registers.ax
Does anyone know what I am missing in order to get it to work consistently?
EDIT:
Just to be clear: I did remember to load the qb.qlb library before trying to call INTERRUPTX.
Do not read if you don't like attention seeking self-advertisements!
Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels