Thread: Assembly equivalent

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    22

    Assembly equivalent

    What is following code in assembly is equivalent of higher language like C?

    Code:
    cwd 
    xor ax,dx
    sub ax,dx
    If you have anything similar assembly snapshot equvalent to C, let me know...

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    My reference for cwd says that the CWD converts a word to a double word.

    I think something similar to this code would be

    typedef unsigned short uint16;
    typedef unsigned int uint32;

    cwd
    xor ax,dx
    sub ax,dx


    uint16 a = 5;
    uint32 b;
    uint32 c = 6;

    b = (uint32)a; // cwd
    b ^= c; // xor
    b -= c; // sub

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  2. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  3. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  4. Bjarne Stoustrup
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 09-05-2002, 06:22 PM
  5. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 03:35 AM