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-ZTYPE RegTypeXax AS INTEGERbx AS INTEGERcx AS INTEGERdx AS INTEGERbp AS INTEGERsi AS INTEGERdi AS INTEGERflags AS INTEGERds AS INTEGERes AS INTEGEREND TYPEDECLARE SUB INTERRUPTX (intnum AS INTEGER, inreg AS RegTypeX, outreg AS RegTypeX)DIM Program AS STRINGDIM Registers AS RegTypeXCLSProgram = "z:\mem.com" + CHR$(0)Registers.ax = &H4B00Registers.ds = VARSEG(Program)Registers.dx = SADD(Program)INTERRUPTX &H21, Registers, RegistersPRINT "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.
My GitHub:
https://github.com/peterswinkels