Results 1 to 9 of 9

Thread: C++ newbie, but asm and vb guru needs help!

  1. #1

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461

    C++ newbie, but asm and vb guru needs help!

    k i need to know all the diffrent data types
    like short int ,int ect and signed, unsigned and how far they go in value .im use to vb and asm declarations of these but i dont know about c++ ones.
    do you have a list or can you type em up for me?
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Code:
    VB           C++
    --------
    Long        long, int  longword  signed 231 -1
                                                    unsigned 232
    
    integer     short                       you lose one bit for signed 
                                                   216
    
    byte         char                         0-255 unsigned  -127 - 127 signed
    
    single       float                         same ranges as in VB
    
    double     double                      same
    There are no unsigned floating point numbers.

    All datatypes are supported as pointers.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The ranges are not quite right:

    C++: long
    signed: -2^31 to (2^31)-1
    unsigned; 0 to 2^32

    short:
    signed: -2^15 to (2^15)-1
    unsigned 0 to 2^16

    char:
    signed: -128 to 127
    unsigned: 0 to 255


    You don't lose bits when it's signed, but the highest bit is used for sign. But I suppose I don't need to tell you what one's complement is...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    what about 8 bytes(currency)? and tbyte(ten byte floating point/real10)
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    _int64 is VC++'s 64 bit (8 byte) data point. The C++ standard says this type is called long long int. The range is signed -2^63 to (2^63)-1 and unsigned 0 to 2^64.
    Currency is not a native data type of C++, it is usually represented by a simple 64 bit integer (don't know whether signed or unsigned).

    10 byte (80 bit) floats are no native data type of Standard C++ either. The x86 floating point unit can't handle those, so if a C++ dialect supports them (there are a few compilers, but not VC++) it needs to emulate this function.
    Compilers for other systems might offer native support for them.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    ten byte floats are native to the x87 fpu, i have used them amlost always in assembly programming.
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  7. #7

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    btw whats the command directive to add assembly code to my program?
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  8. #8
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    Wink

    add assembly to C++ code:

    _asm
    {
    //assembly stuff here!
    }
    VS.NET 2003

    Need to email me?

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Really?

    Interesting....

    Most compilers support this syntax:

    asm op arg;
    asm op arg1, arg2;

    or

    asm {
    op arg
    op arg1, arg2
    }

    VC++ requires _asm instead of asm.

    The C++ standard says this syntax must be supported, but it isn't on most compilers (I think gcc3 supports it)
    asm("op arg");
    asm("op arg1, arg2");

    It's stupid anyway...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width