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 4,603 of 4,675   
   Paul Edwards to Paul Edwards   
   Re: ss and lea on 8086   
   24 Jun 23 22:24:34   
   
   From: mutazilah@nospicedham.gmail.com   
      
   On Sunday, June 25, 2023 at 11:40:47 AM UTC+8, Paul Edwards wrote:   
      
   > I tried zapping the add into a subtract, on the assumption    
   > that it was a compiler bug, since I think I am using 1.52    
   > but I think there is a 1.52C available via patch.    
      
   I appear to have 1.52C as per the name of the CD,   
   even though the label says 1.52.   
      
   Anyway, I believe I have found a compiler bug:   
      
   /*   
      
   This program demonstrates a presumed bug in Visual C++ 1.52C   
      
   When compiled with:   
      
   cl -Fa -c -AH -Ox -f foo.c   
      
   it says it generated:   
      
   add     bx,ax   
   mov     BYTE PTR ss:[bx],OFFSET 88   
      
   but looking at the object code shows:   
      
   03D8 C60758   
      
   Manually assembling with masm shows:   
      
   03 D8				add	bx,ax   
   36: C6 07 58			mov	BYTE PTR ss:[bx],OFFSET 88   
      
   the '36' is the SS override. That is missing from the object code.   
   This only becomes a problem if ds and ss are not the same. Normally   
   they are the same.   
      
   */   
   void foo(int y)   
   {   
       char buf[4];   
      
       buf[3-y] = 'X';   
       bar(buf);   
       return;   
   }   
      
   --- 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