Mike Chambers
Veteran Member
- Joined
- Sep 2, 2006
- Messages
- 2,621
how are you gentlemen.. i've been trying to use function 48h on int 21h to have DOS allocate 64,000 bytes for me. it always errors and reports that the largest free chunk of memory is 5 paragraphs (80 bytes)
the allocated memory MUST be contiguous. am i using the wrong function to accomplish this?
here's how i'm trying to do it:
any ideas? when i run the code above, at least on my 486 canon notejet, it returns this:
the goal here is to use the allocated memory as a VGA framebuffer.
the allocated memory MUST be contiguous. am i using the wrong function to accomplish this?
here's how i'm trying to do it:
Code:
TYPE registers
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
DIM SHARED inreg AS registers
DIM SHARED outreg AS registers
inreg.ax = &H4800
inreg.bx = &H1000
CALL interrupt(&H21, inreg, outreg)
PRINT "Flags:" + STR$(outreg.flags) + " ";
IF (outreg.flags AND 1) = 0 THEN PRINT "(no error)" ELSE PRINT "(error)" 'carry flag set means error
PRINT "AX: " + RIGHT$("000" + HEX$(outreg.ax), 4)
PRINT "BX: " + RIGHT$("000" + HEX$(outreg.bx), 4)
IF (outreg.flags AND 1) = 1 THEN
IF outreg.ax = 7 THEN
PRINT "Error detail: memory control block destroyed."
ELSEIF outreg.ax = 8 THEN
PRINT "Error detail: insufficient memory."
END IF
END IF
any ideas? when i run the code above, at least on my 486 canon notejet, it returns this:
Code:
Flags: 3 (error)
ax = 0008
bx = 0005
Error detail: insufficient memory
the goal here is to use the allocated memory as a VGA framebuffer.