TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SAM IZZO
from: TOM WASSON
date: 1997-12-22 19:25:00
subject: Memory Allocation

  When a *.COM program loads, it is given all the available memory.  Before a 
*.COM program can allocate memory, it must first dealllocate all of the 
memory it owns.  One good way to do this is function 4Ah Int 21h.  The memory 
should be resized to use only the memory in use by the program.  This is how 
I had done it:
                mov     bx,PRG_SIZE * 1024 / 16 ;Reduce memory needs to 19K
                mov     ah,4Ah                  ;where ES=program segment.
                int     21h
  PRG_SIZE is assigned the number of  xxxK bytes required by the *.COM 
program - in this case 19 for a 19K program.
--- Maximus 3.01
---------------
* Origin: Castrovalva BBS 610-917-0380 (1:2626/102)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.