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,019 of 4,675   
   R.Wieser to All   
   Re: Why does adding a 49 prefix to this    
   08 Mar 20 18:28:44   
   
   XPost: comp.lang.forth   
   From: address@nospicedham.not.available   
      
   Albert,   
      
   > That is not how my assembler rolls.   
      
   You are targetting an X86 processor ? Than it /has/ to.   
      
   > It requires to specify whether byte or XELL.   
      
   /How/ you specify it doesn't matter.  /What/ you specify does.   
      
   > xell size depends on the environment (segment type c.q. 32/64 bit mode)   
      
   :-)   You call it "xell", we call it "native size".  In this newsgroup we   
   still recognise a 16-bit native size.   
      
   > *and cannot be specified in the instruction itself*   
      
   Look at the three MOVI instructions I posted.   Where do I specify the size   
   ?   I don't.  Its implicitily taken from the target register.    The same   
   happens when the target is some memory.   
      
   > Most people don't know that there are three instructions   
   > to swap the RAX and the RBX registers, because their   
   > assembler allows one.   
      
   Not /allows/, but /generates/ just an arbitrary one of them.   When the   
   effect is the exactly same, why would you want to be able to pick one   
   yourself ?   What /good/ would that do you ?   
      
   >>> Then the immediate data is always 32 bit and sign extended.   
   >   
   > Confirmed see below   
      
   You have confirmed exactly nothing.    Besides the problem of calling it   
   "always 32 bit and sign extended" and in your conclusion "Looks like a 64   
   bit signed constant" <-no idea where you got that from, but certainly not   
   from your emitted code dump.   
      
   Ask yourself, why would a "MOVI AX, 12" need a four-byte immediate value ?   
   It doesn't.  It could have generated a 05 0C 00 instead.   
      
   Also, when I disassemble the emitted bytes in that dump of yours I get   
   something a bit different:   
      
   58                               pop eax   
   48                               dec eax   
   81 C0 0C 00 00 00    add eax, 000000Ch   
   50                               push eax   
   48                               dec eax   
   AD                              lodsd   
   FF 20                          jmp dword ptr [eax]   
      
   No AX anywhere.    But the 32-bit immediate value now matches the size of   
   the, instead present, EAX register.   
      
   And odd, those /two/ "dec eax"-es in there.    I would have expected just a   
   single one, so why two ?   And why directly after two stack-related   
   instructions ?   
      
   And where has /your/ "$48 C," gone, and what do you think its good for ?   
   As you can see, to the processor its just a DEC EAX ...   
      
   > P.S. If I do an "INT 3" in my interpreter, it just segfaults.   
      
   Too bad, but yes, that can happen when you do not have an X86 single-stepper   
   available.   
      
   > What I call return is code that instructs the interpreter   
   > to execute the next Forth instruction, not an actual RET instruction.   
      
   :-) Yeah, I alread got the feeling that that "lodsd", "jmp [eax]" was to   
   access a pseudo-(call)stack.   
      
   Regards,   
   Rudy Wieser   
      
   --- 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