- - - - - - - - - - - - - -Readme.txt- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This example was written by Thomas Bleeker on MASM.

Its purpose is to provide a basic example of how one can use our OOP model
to create and manage a large number of sprite objects and display them using
windows' GUI.

On C-- this example adapting by Michael Sheker.
Compiled on MASM output file is 14 kb size. Compiled on C-- - 7 kb.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Don't ask me how they do that :grin:

Just look at this sphinx C--
Posted on 2003-05-20 10:19:24 by QS_Ong
Its all about the command link switches for the linker.. im sure if i tried i can get it down that far as well with MASM32.

:NaN:
Posted on 2003-05-20 22:16:04 by NaN
Indeed, Nan and Thomas's OOP model had a lot of problems, but it is the most known OOP model under asm, and giving us a good example how to implement our idea in MACRO. I am working on a project to improve somewhat rewiritten the model, may be by the time I finished, you can see something interesting about how OOP can be implemented in ASM, and without a lot overhead both in the space and time.
Posted on 2003-05-21 01:56:39 by taowen2002
Adding /FILEALIGN:512 gets it down to 8kb.. Our model has some overhead that isn't necessary, for example all methods are virtual. And the example wasn't written to be small, it was written as an example of using the object model. The c-- compiler will probably also use fast calling methods (with registers) or inline them so that might save space as well..

Thomas
Posted on 2003-05-21 02:53:06 by Thomas

Indeed, Nan and Thomas's OOP model had a lot of problems...


: I wouldnt say it has *alot*, but i will admit its not perfect.
Posted on 2003-05-21 17:01:37 by NaN

Indeed, Nan and Thomas's OOP model had a lot of problems, but it is the most known OOP model under asm, and giving us a good example how to implement our idea in MACRO. I am working on a project to improve somewhat rewiritten the model, may be by the time I finished, you can see something interesting about how OOP can be implemented in ASM, and without a lot overhead both in the space and time.


Seems you always think others' stuff is terrible and yours is the best.
A wise man should learn how to respect the others.
Your assembly is only at beginner level according your post, what you should discuss is how to use assembly, not how to laugh at or blame others.
And even you become an asm guru in the far future, there are still many other men better than you.
My many asm guru friends alway do hard to help the others and they never laugh at others.
Posted on 2003-05-21 22:12:45 by KomsBomb
I am really sorry that I used the wrong words. I like the Nan and Thomas's work, sorry.
Posted on 2003-05-21 22:17:09 by taowen2002
taowen2002,

Do not be appologetic. Im not offended, and look forward to reviewing your ideas. I was stepping in to clear the air in our own defense. By not saying as such, it may give the impression I agree fully on what you had written ;)

I understand English is not your first language, and personally knew what your getting at (i too could have expressed myself better in this way ~ so that we wouldnt be here appologizing to each other ;) )

:alright:
NaN
Posted on 2003-05-22 16:28:43 by NaN
Thank you for your magnanimity.
I found there were serval things need to be improved in your model, and that's why I started my project. Here, I try to list the things that I think inconvenient
1, Have to declare proto for member method
2, Have to decorate the member method manually
3, Have to describe the offset of the virutal method manually
4, Have to use a virtual destructor
5, Have to make all methods virtual
6, Virtual methods existes in the object itself not a seperate table
---
1, stack based oject to be added
2, dynamic method to be added
3, more powerful SUPER
4, global object to be added
5, access level to be added

I have achieved some of the goals listed above. I list a example, I invented a more comprehensive way to use the object


TestProc Proc uses edi esi
VAR pCBase:PTR CBase
NEW pCBase, CBase
VIA pCBase, edi, esi ;specify the reg to store the pointer to object and vtbl
mov pCBase_I, 1 ;the _ means the . or -> in C++
invoke pCBase_Show;the _ means the . or -> in C++
DESTROY pCBase
ret
TestProc Endp


My biggest principle of design is making the syntax to be most comprehensive. The work is under construction, and I have confidence to give a final solution.
Don't ask What is the meaning of the model? It may be useless or not, I just want to get fun and experience from the process.
Posted on 2003-05-22 21:11:12 by taowen2002