Basic Example Using SETMEM to Allocate Far Heap Memory; EXEMOD (31308)
The information in this article applies to:
- Microsoft Visual Basic for MS-DOS
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System for MS-DOS 7.0
- Microsoft Basic Professional Development System for MS-DOS 7.1
This article was previously published under Q31308 SUMMARY
To allocate a reserved location in memory that compiled Basic will not
touch, you can deallocate some memory by using the SETMEM function
(see the Basic language reference manual and the example for SETMEM
below). Then, using either CALL INTERRUPT or CALL INT86OLD, execute a
MS-DOS Interrupt 21 hex (33 decimal), with function 48 hex (72 decimal)
to obtain the address of the memory freed in far memory. Call with AX
equal to &H4800 and BX equal to the number of paragraphs of memory
needed (the number of bytes of memory needed, divided by 16).
If the function succeeds, the flag is clear and AX returns the initial
segment (paragraph address) of the allocated block.
If the function fails, the flag is set and AX either is 7 (if memory
control blocks were destroyed) or 8 (if memory was insufficient, in
which case BX gives the size of the largest available block).
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB31308 |
---|
|