OOP and inline asm in VC++ 6

Discussion in 'C++' started by Nico Vrouwe, Jul 29, 2003.

  1. Nico Vrouwe

    Nico Vrouwe Guest

    Hi!

    I wrote a pretty nice D3D framework in C++. Everything is done in classes
    and it all works great.
    Now I want to make a special version of it that is as small as possible. But
    I want to keep all the classes and basically maintain full compatibility
    with the "full" system. Some features will of course be left out, but
    otherwise I shouldn't have to change any code in the applications using the
    system.

    From the beginning I already had this in my head so I can comment almost
    every feature out with a lot of #defines. And it gets a lot smaller. But now
    I want to push it to the limit using ASM. I figured I can decrease the total
    code size by at least a couple of k's when applying all my nasty tricks :)

    Anyway, I just got started and already ran into the first 2 problems:

    1) I'm using VC6 and apparently imports aren't handled automatically when an
    API function is only called from an ASM block. Manually importing all
    functions seems a bit unnecessary so anyone knows of a better solution?

    2) OOP. I know how to access data members of an object, but can't figure out
    how to call member functions. It seems MS's compiler wastes a lot of bytes
    for every "Object *bla = new Object()" so I'd really like to have that in
    ASM. But I have no clue how to call the constructor of the object.

    A sidenote.. Code readability is not really an issue here. My framework is
    in a stable state right now, and this small version is going to be for hacky
    64k versions. This version of the framework will exist purely to get it as
    small as possible. Every dword counts :)

    I googled for quite a while now without getting any usable results.

    Hope someone here can help me :)

    /Nico
    Nico Vrouwe, Jul 29, 2003
    #1
    1. Advertising

  2. "Nico Vrouwe" <> wrote...
    > [...]
    > 1) I'm using VC6 and apparently imports aren't handled automatically when

    an
    > API function is only called from an ASM block. Manually importing all
    > functions seems a bit unnecessary so anyone knows of a better solution?
    >
    > 2) OOP. I know how to access data members of an object, but can't figure

    out
    > how to call member functions. It seems MS's compiler wastes a lot of bytes
    > for every "Object *bla = new Object()" so I'd really like to have that in
    > ASM. But I have no clue how to call the constructor of the object.
    > [...]
    > Hope someone here can help me :)


    Sorry to disappoint you, but no, _here_ both things are OT,
    since they are heavily compiler-specific. Please consider
    asking in 'microsoft.public.vc.language'. If your newsserver
    doesn't carry those, connect to msnews.microsoft.com.

    Good luck!

    Victor
    Victor Bazarov, Jul 29, 2003
    #2
    1. Advertising

  3. Nico Vrouwe

    Nico Vrouwe Guest

    "Victor Bazarov" <> wrote in message
    news:L2kVa.2613$o%2.2552@sccrnsc02...
    > Sorry to disappoint you, but no, _here_ both things are OT,
    > since they are heavily compiler-specific. Please consider
    > asking in 'microsoft.public.vc.language'. If your newsserver
    > doesn't carry those, connect to msnews.microsoft.com.
    >
    > Good luck!
    >
    > Victor


    Thanks for the tip :)

    /Nico
    Nico Vrouwe, Jul 29, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cristian Tota

    inline asm portability

    Cristian Tota, Nov 22, 2003, in forum: C++
    Replies:
    4
    Views:
    347
    Pete Becker
    Nov 23, 2003
  2. __PPS__

    c++ & inline asm

    __PPS__, Apr 6, 2005, in forum: C++
    Replies:
    5
    Views:
    470
  3. Inline asm commands

    , Oct 7, 2005, in forum: C Programming
    Replies:
    7
    Views:
    357
    Mabden
    Oct 15, 2005
  4. Protoman
    Replies:
    10
    Views:
    659
    Protoman
    Aug 6, 2006
  5. Allen
    Replies:
    9
    Views:
    1,043
    Thomas J. Gritzan
    Jun 16, 2007
Loading...

Share This Page