home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,611 of 4,675   
   Rick C. Hodgin to R.Wieser   
   Re: EXE program stack setup questions   
   18 Oct 18 06:07:13   
   
   From: rick.c.hodgin@gmail.com   
      
   On Thursday, October 18, 2018 at 2:35:43 AM UTC-4, R.Wieser wrote:   
   > Rick,   
   >   
   > > There's no way to know how much memory is there though.   
   >   
   > Actually, there is:  just look into the MCB preceeding the PSP.  The second   
   > and third bytes hold the size (in segments) of the allocated block.   
   >   
   > Its just that resizing by using INT 21 AH=4Ah swats two flies in one go: It   
   > either gives you what you want (and thats that), or when failing tells you   
   > whats left (and you can either bail out or try to remedy the problem).   
      
   That doesn't seem like a well-documented thing, and possibly a   
   thing that could change between DOS versions, or between IBM DOS   
   and MS-DOS and Dr. DOS, etc.   
      
   Is there no INT 21h function which allows it through the standard   
   DOS API?   
      
   That may be why I never found it / used it.  It's like walking in   
   to the transformer room unshielded.  You're good so long as you   
   handle and treat everything with proper care and respect, but one   
   wrong move and you're zapped with 10s of thousands of volts, i.e.   
   dead on the scene.   
      
   It sounds risky, dangerous, and I would say unless you're in a   
   static environment and can verify your solution is working prop-   
   erly, then avoid it.   
      
   Of course that's just my opinion.  But, I'm probably right. :-)   
      
   --   
   Rick C. Hodgin   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca