OOP and inline asm in VC++ 6

N

Nico Vrouwe

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
 
V

Victor Bazarov

Nico Vrouwe said:
[...]
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
 
N

Nico Vrouwe

Victor Bazarov said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top