Results 1 to 4 of 4

Thread: tell msvc++ to supress all __asm errors,

  1. #1

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

    tell msvc++ to supress all __asm errors,

    okay, i want to use my asm knowledge to speed up a part in my c++ app. my errorss are below and the code. i numberd the conflicting lines. how would i supress these, or fix them. btw i used debug to get the asm code and offsets etc.

    F:\C++\newprojects\primes\primesc.cpp(113) : error C2414: illegal number of operands
    F:\C++\newprojects\primes\primesc.cpp(128) : error C2405: illegal short forward reference with offset
    F:\C++\newprojects\primes\primesc.cpp(130) : error C2405: illegal short forward reference with offset


    // A = A % B;
    // T = A;
    // A = B;
    // B = T;
    // }
    __asm {
    mov eax,ecx
    xor edx,edx
    div eax,edi
    line113: mov ecx,edx
    mov esi ,ecx
    mov ecx,edi
    mov edi,esi
    jmp loopz0rz+28h
    }



    // if (A != 1 && A != I)
    // Prime = 0;
    // G = G + 1;

    // } //end 3
    __asm {
    cmp ecx,1
    je loopz0rz+67h
    line128: cmp ecx,dword ptr [ebp-10h]
    je loopz0rz+67h
    line130: mov dword ptr [ebp-8],0
    inc ebx
    jmp loopz0rz+0Eh
    }
    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
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Never assume anything about addresses or offsets, the compiler might optimize a byte away and you stand there pretty much ****ed.

    div takes only one argument, eax is implied.
    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.

  3. #3

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    hmm, in the window it was, div eax, dword ptr[somestack]
    i still get errors like that, how do i tell it to compile any ways?
    Last edited by Cmdr0Sunburn; Dec 13th, 2002 at 07:36 PM.
    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 {
    }

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You can't.
    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