Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

real mode memory management question (Developers)

posted by Japheth Homepage, Germany (South), 24.08.2008, 21:27

> 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:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 127 users online (0 registered, 127 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum