Assembly in C code?

This is a discussion on Assembly in C code? within the C Programming forums, part of the General Programming Boards category; I cry now....

  1. #16
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    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

    website: http://0xff.ath.cx/~as/

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    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
    Posts
    357
    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
    Posts
    9,796
    >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.

Page 2 of 2 FirstFirst 12
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, 04: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21