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,562 of 4,675   
   R.Wieser to All   
   Re: EXE program stack setup questions   
   08 Oct 18 10:26:23   
   
   From: address@nospicedham.not.available   
      
   Alexei,   
      
   > Here's mine:   
   > 000: 4D 5A 40 00 02 00 00 00 ? 20 00 00 01 FF FF 00 00   
   > 010: 40 10 00 00 00 00 00 00 ? 3E 00 00 00 01 00 FB 30   
   > 020: 6A 72 00 00 00 00 00 00 ? 00 00 00 00 00 00 00 00   
   >...   
   > 200: 8C C8 8E D8 8E C0 50 53 ? E8 08 00 83 C4 04 B8 00   
   > 210: 4C CD 21 55 8B EC 83 EC ? 10 53 56 57 8D 7E F0 B9   
      
   And this is mine:   
   000 4D 5A EB 00 03 00 00 00 20 00 91 00 FF FF 2F 00   
   010 00 01 00 00 00 00 00 00 3E 00 00 00 01 00 FB 71   
   020 6A 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
   ....   
   200 2E 8C 0E D0 00 2E 8C 16 D2 00 2E 89 26 D4 00 2E   
   210 8C 1E D6 00 2E 89 36 D8 00 2E 8C 06 DA 00 2E 89   
      
   (guess how I got my register values :-) )   
      
   > This line   
   >  myseg segment para stack 'stack' use16   
   > tells tasm that myseg *is* *the* stack segment.   
      
   Look at the above dumps, and compare the bytes at 0Eh...0Fh.   Your   
   assembler / linker keeps the SS offset at Zero (and probably sets SP to the   
   programs memory size), while mine changes it to match the defined stack   
   segment (with SP the size of that segment).    Which I have been telling you   
   from the start and have been repeating thruout our conversation.  Why did   
   you refuse to accept it ?   
      
   But, now you've got your facts straight (I hope), can we now at long last   
   try to figure out a solution to the problem as I described it in my first   
   post ?   
      
   I would like to see (if it exists) a programmatic solution of it, but   
   preferrably another kind (Borlands Tasm specific?) of way of defining the   
   stack.   
      
   I would be much obliged.   
      
   Regards,   
   Rudy Wieser   
      
   P.s.   
   I've already got an "exefix" written to both set the "max amount of extra   
   memory" to the "min ammount of extra memory", as well as calculating the   
   memory size of the full program and setting SP to that (with SS set to   
   Zero).    Would still rather use a sourcefile-based solution though.   
      
   And a funny: I declared a 0800h bytes of uninitialized memory (and no   
   stack), but saw the value 0081h turn up in the EXE header   
   (min_extra_paragraphs).  Declaring a byte less shrunk it to 0080h.   Most   
   likely a classic off-by-one error. :-)   
      
   --- 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