By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,260 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,260 IT Pros & Developers. It's quick & easy.

OOP and inline asm in VC++ 6

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Nico Vrouwe" <ni**@hotmail.com> 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
Jul 19 '05 #2

P: n/a
"Victor Bazarov" <v.********@attAbi.com> 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
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.