473,473 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OOP and inline asm in VC++ 6

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
2 2576
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
Hello all, I have one method of a class calling another method (both private, though that shouldn't matter). The method and its enclosing class are declared in a .h file and the method is...
6
by: John Ratliff | last post by:
I was reading the C++ FAQ Lite about inline functions, and it says the following (http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7) " It's usually imperative that the...
3
by: Ian | last post by:
Peace, language lawyers! I'm developing a (static) library for a "memory-challenged" platform (ie, mobile). I want to (force the compiler to) inline some functions -- that are not meant to be...
5
by: Ondrej Spanel | last post by:
I though that inline functions should be always visible only in the compilation unit where they are defined - meaning if compiler cannot inline them, they should be handled as if declared static....
7
by: Michael Kennedy [UB] | last post by:
Hi, I am back with more bug reports from Visual Studio.NET 2003's C++ compiler (unmanaged). Consider the following method: --------------------------------------------- __forceinline bool...
6
by: Sharon | last post by:
Usually it is common to write the class member function in the class H file, but some people like to write the function body in the C++ file. Can anybody tell me what are the cases where inline...
5
by: Bert Jansen | last post by:
There seems to be a bug in de VS .net C++ compiler (optimization) when using inline functions that return static data. The following code demonstrates this (Win32 console app with ATL support): ...
2
by: Amal P | last post by:
Hi, This is the program that i made to test the usage of inline function. I am using vc 6.0 compiler. Please see the below program. int NonInline( int a, int b ) { return ( a b )? a: b; }
3
by: starffly | last post by:
I overloaded operator+ in a class, and I want to invoke this operator in inline assemble like this: _asm call operator+ but it cannot be complied OK. compiler says there are some illegalI...
2
by: Allen | last post by:
Last time, i post a topic about inline class member declaration in C++. And in VC6, it does not support inline class member. Now I upgrade to VC 2005. But the compiler doesnot completely support...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.