| helios (10258) | ||
| ||
|
|
||
| Imadatobanisa (647) | |||
|
Ah.. Just try translating and replacing about 50% C++ code with assembly.... In my opinion assembly is the fastest, and optimizing them by assembly is a great choice... :) I'm trying getting function addresses from structures. But, something blocks me, and here is an example :
Anyways it only gives crazy compling errors... Am I doing anything wrong? :( | |||
|
Last edited on
|
|||
| L B (3806) | |
| Unless your compiler is braindead, it will probably write better, faster, smaller, and more efficient assembly than you ever will, even with optimizations disabled. | |
|
|
|
| chrisname (6181) | |
| Yes; std::vector::begin() is a function, not a variable. | |
|
|
|
| supperpiccle (67) | |
| You just need to give up with the questions you ask you are just making stuff up i guess | |
|
|
|
| Imadatobanisa (647) | |
|
I am making & writing documentation. So now no need to post long updates... :) About documentation : Which file format is best? CHM, HTML, or anything else? Macro library is almost done. I only try to complete code replacing, that means it will compile the string inside the macro instead (If it supports). An example "DECIMAL" contains "double", so certainly the parser will find and compile the inside string "double" of the macro. "Macro" also has a higher level of precedence than functions and numbers. :) What is intelligent compiler-interpreter? | |
|
Last edited on
|
|
| L B (3806) | |
| HelpNDoc is great for CHM documentation: http://www.helpndoc.com/ | |
|
|
|
| Catfish3 (275) | |
|
You had better post your interpreter thing in the Articles section when it's done! (Yeah, right.) | |
|
|
|
| Imadatobanisa (647) | ||||||
EDIT : Thanks L B & Catfish3... :)
No. But actually a function also is an address, right? Every function contains its address information so that the program can locate and then call them exactly. So what I really need is "function address". It's not a common function variable, it's "structure -> function". Come back to the example :
Another example : Many structures (DIRECTX) have their inside functions. (The problem here, the compiler doesn't accept it.)
Without structure & function, the interpreter probably will never be done. Now absolutely I want to get a function address which is hidden behind a structure. What should I do now? | ||||||
|
Last edited on
|
||||||
| helios (10258) | ||
| ||
|
|
||
| EssGeEich (1007) | |||
fprint_address = (void*)NUMBER::fprint; //FAILED It's because fprint is not a static function. You remind the topic about the 'this' pointer? Well I explained you the 'this' pointer goes in ecx, then you will be able to call NUMBER::fprint. Also in ASM you need no ';' at the end of a line, check that out. Try
I didn't test it but that should work. | |||
|
|
|||
| iseeplusplus (363) | |||
|
You need an instance of vector, and get a function pointer to its member function. I don't know if this works.
| |||
|
Last edited on
|
|||
| Imadatobanisa (647) | |||
Yeah, this is my goal :
| |||
|
Last edited on
|
|||
| Imadatobanisa (647) | |||||||||||
|
Wow! With template function I successfully converted a function member to an address!!!! Because C++ does not support __thiscall definition, so I had a new idea : Defining a template function instead. It's much simpler I think :)-> Firstly, see my goal above :D And here, this is a trick which can get function member address easily :
With NUMBER structure example above, for example :- This is an example code which is used to get address of the function NUMBER::PRINT :
- Finally try implementing PRINT function using the output address :
It's so awesome!!! Wow, The hardest problem has been solved!!!!!!!!!!!!!!!!!!! How does it work?
But, what is the hell? (I HAVE TO CREATE A NEW TEMPLATE FOR EVERY SET OF ARGUMENT TYPES) :( Like I mentioned before, the comment //Only for syntax "void FUNC(void)" , you will see it's extremely specific. Imagine it looks like "LOCK" - "KEY". Each template can only handle a single specific case. If you pick a wrong converter, the process will fall which result in compiling errors.
Finally four remaining functions NUMBER::GETA, NUMBER::SETA, NUMBER::GETB, NUMBER::SETB : Cry!!!
-> So with structure example, at least I have to make two other versions of converter to get their addresses properly!! Does anyone have any idea "the generic version of the converter which is able to convert any function member to address"? Any help would be very helpful XDXD | |||||||||||
|
Last edited on
|
|||||||||||
| gtm (53) | |
| jesus christ what a clusterfuck | |
|
|
|
| EssGeEich (1007) | |
| Someone tells me his/her level of C++ knowledge. So, you don't know for's but you know templates? What the hell? | |
|
|
|
| Imadatobanisa (647) | ||
|
@coder777 Wow. I never have seen this. It's very new to me. Very interesting!!! XDXD But, I have some questions : Can the boost function member variable be converted into a *void address value? Is it structure or regular value? And could you show me an example how to get, store the result into a void* then print the output address of a member function properly? :)
| ||
|
Last edited on
|
||
| TheIdeasMan (1753) | |
|
@gtm I agree. I picked this thread as being complete BS near the start, and I was criticised for not being tolerant enough. So then we had about 500 posts of more BS. Then Jackson Marie had her? account restricted (not sure what led to that, but presumably warned by admin), then renamed to Imadatobanisa. I didn't believe one word of the excuses posted in the OP's Bio at that time. Account reinstated, now more of the same BS. I can only think that it keeps continuing because people continue to reply. Also, I think that it may be one of the strategies of a troll to take on a female role to try to endear themselves to the male members on this site. I wouldn't be the least surprised if the OP was really a middle aged man on the same psychological plane as those who write viruses. @EssGeEich I agree with you too. Questions about loops and cout, but code with templates & asm? Of course the real proof would be for the OP to post all the code, but I very much doubt that will happen. Others have requested it, and it hasn't happened yet. If code was posted I think it would be rather easy to spot the difference between your original code, and the OP's I think time-wasters like the OP should have a permanent ban. If you are not happy - send a message to admin. Any way this is all my opinion, but I would urge others to help stop this continued non sense. | |
|
|
|
| Zereo (410) | |
|
I told myself I would stop replying to this thread and hopefully JM would stop giving "Updates", but I wanted to break that rule to just say this. Amen TheIdeasMan Amen Now I'm gone again :) | |
|
|
|