how does DOS manage the memory usage of a .COM file?
i want more than the standard 64k in a COM file so i started experimenting
with INT21 function 48h and 49h, memory allocation and deallocation respectively.
i used the following code in a COM file to find out the maximum number of
paragraphs (paragraph=16kb?) available to my program:
mov ax,4800h
mov bx,0FFFFh ;request 65535 paragraphs (1.073.725.440 bytes?).
int 21h
the code returns DOS error code 08h (insufficient memory) ofcourse, but in this
case it also returns the maximum available paragraphs. i ran it on various systems
and configurations and found the following returned:
win95 dosbox: 0 paragraphs available
win95 pure dos: 4 paragraphs available
dos 6.22: 4 paragraphs available
win2k dosbox: 7 paragraphs available
i also read somewhere that DOS assigns ALL available memory to a COM file when
it loads. if this is true, then why do the last three configs still return >0
paragraphs available?
or can i just ASSUME that all memory is available to me and ignore function 48h
and 49h all together? (i never use any TSRs so that won't be a problem).
thx.
i want more than the standard 64k in a COM file so i started experimenting
with INT21 function 48h and 49h, memory allocation and deallocation respectively.
i used the following code in a COM file to find out the maximum number of
paragraphs (paragraph=16kb?) available to my program:
mov ax,4800h
mov bx,0FFFFh ;request 65535 paragraphs (1.073.725.440 bytes?).
int 21h
the code returns DOS error code 08h (insufficient memory) ofcourse, but in this
case it also returns the maximum available paragraphs. i ran it on various systems
and configurations and found the following returned:
win95 dosbox: 0 paragraphs available
win95 pure dos: 4 paragraphs available
dos 6.22: 4 paragraphs available
win2k dosbox: 7 paragraphs available
i also read somewhere that DOS assigns ALL available memory to a COM file when
it loads. if this is true, then why do the last three configs still return >0
paragraphs available?
or can i just ASSUME that all memory is available to me and ignore function 48h
and 49h all together? (i never use any TSRs so that won't be a problem).
thx.