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,142 of 4,675   
   Bernhard Schornak to wolfgang kern   
   Re: sys_read from stdin   
   30 Nov 17 12:46:06   
   
   From: schornak@nospicedham.web.de   
      
   wolfgang kern wrote:   
      
      
   > Bernhard Schornak translated:   
   >>>>>>  MOV AL,[charbuffer_in]   
   >>>>>>  MOV AH,0   
   > ...   
   >> Hit and sunken! ;)   
   >   
   >> Actually it's a (bad) translation from   
   >>   
   >> movzb 0x00(buffer), %eax   
   >>   
   >> to LETNi syntax.   
   > :)   
   >   
   > just to add some confusion about MOVZX/MOVSX:   
   > this instructions exist in two forms:   
   >   
   > 0F B6 r/rm   MOVZX(B) 0F B7 r/rm   MOVZX(W)   
   >   
   > some tools need "MOVZX byte ..." while others use register size.   
   > ie: MOVZX AX,DL and MOVZX ESI,CX shouldn't need a size cast, in opposition   
   to movzx (e/r)ax [mem],   
   > here the assembler need to know "byte or word".   
      
      
   However (I'm not sitting inside the x86 processor like you ;))   
   the important part is the execution stall triggered by loading   
   AL and clearing AH with two consecutive instructions. If there   
   was no MOVZX, it still was a better idea to clear EAX at least   
   ten instructions before loading AL. After all: AL, AH, and AX/   
   EAX just are parts of the full 64 bit register called RAX (ex-   
   cept you run ancient hardware produced before 2003...), and it   
   takes time to manipulate smaller (8 bit wide) parts of this 64   
   bit wide hardware structure in a row.   
      
      
   Have a nice weekend (und Pfüat'Di Wolfgang)   
      
   Bernhard (Schornak)   
      
   --- 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