real mode memory management question (Developers)
> dos_allocmem exists but the informations found on google are very rare.
this is what I found (MS VC 1.5):
---------------------------------------------------------------
unsigned _dos_allocmem( unsigned size, unsigned *seg );
size Block size to allocate
seg Return buffer for segment descriptor
#include <dos.h>
#include <errno.h>
Remarks
The _dos_allocmem function uses MS-DOS service 0x48 to allocate a block of memory size
paragraphs long. (A paragraph is 16 bytes.) Allocated blocks are
always paragraph aligned. The segment descriptor for the initial segment of the new block is returned in the word that seg points to. If the request cannot be satisfied, the maximum possible size (in paragraphs) is returned in this word instead.
Return Value
If successful, the _dos_allocmem routine returns 0. Otherwise, it returns the MS-DOS error code and sets errno to ENOMEM, indicating insufficient memory or invalid arena (memory area) headers.
---------------------------------------------------------------
---
MS-DOS forever!
Complete thread:
- real mode memory management question - mr, 24.08.2008, 18:42 (Developers)
- real mode memory management question - Japheth, 24.08.2008, 21:03
- real mode memory management question - mr, 24.08.2008, 21:19
- real mode memory management question - Japheth, 24.08.2008, 21:27
- real mode memory management question - mr, 24.08.2008, 21:19
- real mode memory management question - rr, 24.08.2008, 23:17
- real mode memory management question - mr, 24.08.2008, 23:30
- real mode memory management question - rr, 24.08.2008, 23:42
- real mode memory management question - mr, 25.08.2008, 00:53
- real mode memory management question - Rugxulo, 25.08.2008, 03:53
- real mode memory management question - marcov, 25.08.2008, 10:34
- real mode memory management question - Rugxulo, 25.08.2008, 03:53
- real mode memory management question - mr, 25.08.2008, 00:53
- real mode memory management question - rr, 24.08.2008, 23:42
- real mode memory management question - mr, 24.08.2008, 23:30
- real mode memory management question - marcov, 25.08.2008, 10:51
- real mode memory management question - Japheth, 24.08.2008, 21:03