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 2,959 of 4,675   
   wolfgang kern to firr   
   Re: asm improvements?   
   27 Aug 17 10:49:16   
   
   From: nowhere@never.at   
      
   "firr" wrote:   
   >> im typing in some more menmonics and thing that surprised me   
      
   >> mov eax, eax   
   >> mov ebx, ebx   
   >> mov ecx, ecx   
   >> mov edx, edx   
   >>   
   >> mov eax, [eax]   
   >> mov ebx, [ebx]   
   >> mov ecx, [ecx]   
   >> mov edx, [edx]   
   >>   
   >> do it really works?   
      
   yes they work, at least in 32-bit mode.   
      
   ...   
   >     eax = eax;   
   >     ebx = ebx;   
   >     ecx = ecx;   
   >     edx = edx;   
   >   
   >     eax = [eax];   
   >     ebx = [ebx];   
   >     ecx = [ecx];   
   >     edx = [edx];   
      
   > For common operations, it would work well:   
   >   
   >     eax *= ebx;   
   >     edx += [esi+ebx+4];   
   >     ebx = myVar[esi+ebx];   
   >   
      
   | now this is no assembler (it is samll 'script' though compiled  language)   
   | (asembler is when you see atomic instructions)   
      
   It is "Terse", an assembler language. Me too use equations instead of   
   MOV, LD, ST and if required I precede it with Sx Zx followed by b/w/d/q,   
   but I use Intel memnonics for all others like ADD,ADC,SUB,SBB...   
   So 64 bit instructions may ie. read on my disassembler as:   
      
   03 00           ADD RAX,Zxd[RAX]   ;instead of ADD eax,[rax]   
   8B 00           RAX=Zxd[RAX]       ;instead of MOV eax,[rax]   
   41 0F B6 34 81  RSI=Zxb[RQ9+RAX*4] ;instead of movzx esi,byte[...]   
      
   just to show what really happens and to avoid guessing the high 32 bits.   
      
   [...about register names]   
      
   you are free to decide and may rename all registers after girls,   
   but I heavy daubt that this make your source better readable.   
      
   I can use optional (also vital for other than x86 CPUs) RL0...RQF where   
   the second letter indicate size (L=lowbyte H=highbyte W/D/Q) and the last   
   is the physical register number (0..15 in hex).   
      
   btw: your 32-bit windoze assembler may already exists, look for RosAsm.   
   __   
   wolfgang   
      
   --- 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