Thread: Assembly in C code?

  1. #16
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    I cry now.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git


  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Hmm let's see....Java or AT&T syntax.

    Damn, I think in this case Java might actually win.

  3. #18
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    AT&T syntax is:
    instruction src,dst
    intel is
    instruction dst,src

    Also under at&t:
    Not all instructions are backwards (they need to pick one)
    In C you don't write &a = c; to set c to the address of a, so you shouldn't mov src,dst
    The data size the instruction operates on is in each mnemonic (it should just figure it out):
    intel: mov ax,4
    at&t: movw 5,%ax
    Addressing is awkward:
    intel: mov ax,[varFace*2+6]
    at&t: movw 6(varFace,,2),%ax
    It just sucks

  4. #19
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    >In C you don't write &a = c; to set c to the address of a, so you shouldn't mov src,dst
    Speaking of backwards...
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-02-2008, 10:00 PM
  2. Obfuscated Code Contest: The Results
    By Stack Overflow in forum Contests Board
    Replies: 29
    Last Post: 02-18-2005, 05:39 PM
  3. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Linux Programming
    Replies: 0
    Last Post: 10-14-2002, 01:30 PM
  4. The relationship between C++ and assembly and machine code
    By TotalBeginner in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2002, 02:46 PM