|
hi guys,
i'm looking for a way to write a complete __fastcall function in inline assembler, and i want to skip the epilog and prelog routines.
when using __declspec there is the possibility to use the naked keyword, which doesn't work for __fastcall.
is there any solution?
thx for your answers.
Alexander M.
Don't try it, just do it!
|
|
|
|
|
Probably not a good idea, even it you could do it. Note from MSDN __fastcall article: "Future compiler versions may use different registers to store parameters.". What I would do is write the function using inlining with in line asm wrapped in the function and let the compiler work out the details, it is very good at that. Heck, if the function is small enough, the compiler is very good a inlining (optimizing) it for you, if written in C/C++.
Good luck!
INTP
|
|
|
|
|
there is just a little problem... the compiler wont use SIMD instructions for me!
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
the compiler wont use SIMD instructions for me!
Well, you can still do inline assembly, can't you?
--
I am perpetual, I keep the country clean.
|
|
|
|
|
By the way, if you decide to inline things, make sure you pass any object to the function by reference. That way the compiler can generate the inlined function without any "extra code".
--
I am perpetual, I keep the country clean.
|
|
|
|
|
no, u don't understand...
when i use the __fastcall calling convention in a file, then the 2 parameters are in ECX and EDX.
but the prelog code of the compiler overwrites them...
so my inline asm doesnt work anymore.
Don't try it, just do it!
|
|
|
|
|
Why are they overwritten!? __fastcall specifies that the first two parameters smaller or equal to a DWORD, are passed via ECX and EDX respectively. If that's the contract of __fastcall, then the prolog shall not mess with those registers. In fact, it doesn't as far as I can tell.
--
I am perpetual, I keep the country clean.
|
|
|
|
|
Dear Experts
In my program,I need to have two independent loops that run at different speeds,30Hz and ~1KHz.They don't share a database.The second loop will only run if a condition in the first one is fulfilled.In this case the first one sends an integer to 2nd one and the second one should process the data with the given speed.this is the scenario,but I don't know how to implement it.At the moment I have a 30Hz timer in my application .At each interrupt of the timer,some function are called.I dont know where to put the second timer and how to start the 2nd thread.can anyone of u experts,helps a completly confused novice
Many thanks
p.s.By the way my program is an SDI application
|
|
|
|
|
There are several solutions. One solution is to use a kernel object to control the section worker thread from the first worker thread. Share data between the two threads via pointers.
Kuphryn
|
|
|
|
|
Why not run them in the same thread? One is close enough to be a multiple of the other that it should work.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Dear Experts
In my program,I need to have two independent loops that run at different speeds,30Hz and ~1KHz.They don't share a database.The second loop will only run if a condition in the first one is fulfilled.In this case the first one sends an integer to 2nd one and the second one should process the data with the given speed.this is the scenario,but I don't know how to implement it.At the moment I have a 30Hz timer in my application .At each interrupt of the timer,some function are called.I dont know where to put the second timer and how to start the 2nd thread.can anyone of u experts,helps a completly confused connovice
Many thanks
p.s.By the way my program is an SDI application
|
|
|
|
|
|
I want to write a program that comunicates with another on the same network. There are probably a couple ways to do this but i have no idea where to look up info on doing this. Im completly new to this so if there are any tutorals on thos or examples links would be apperciated
|
|
|
|
|
Search for "Beej's Guide to Network Programming" on google.. easily available online.. It is very good beginning resource for socket programming to communicate on network
hope that helps
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
For a quick tutorial on winsock, check out this site.
http://www.tangentsoft.net/wskfaq/
I highly recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.
Kuphryn
|
|
|
|
|
|
Hi all, ibe imported a bitmap to my app, and now i get the following warning:
Build : warning : failed to (or don't know how to)build 'D:\Code\FixDesp\vsp.bmp'
i imported the bitmap the "usual" way via the resource pane ->import... context menu option.
im using VC6 in a WTL7 project
any idea of what im doing wrong?
Thanks!
UPDATE:
ibe imported an icon, and i got another warning for it!
WTF??
|
|
|
|
|
Perhaps your file is a mis-named .bmp file ? perhaps it's a JPG or something like that ?
Try to open it with ms-paint and see what happens, same goes for the icon.
|
|
|
|
|
Thanks for your answer.
the bitmap is a "standard" .bmp file, same goes for the icon its a normal .ico file.
I just spent about 40 minutes triple-checking everything, and i have no clue as to what im i doing wrong, ibe imported bitmaps, icons, .wav files, and even custom resources tons of times before and i never had any trouble.
|
|
|
|
|
It's starting to soudn interesting
The next thing I'd try if I were you was to create a New Blank MFC App and throw the resources in there, see what happens.
If it works it means something is messed up with your current-project, so you can start comparing project settings.
If it doesn't work, well then either the bitmaps end up being corrupt or your VC is malfunctioning
|
|
|
|
|
This is weird!, i just created a new project, imported the exact same icon & bitmap and got no warnings at all, i compared every project setting (twice) and they are excacly the same!, yet i still get the same warnings on the original app!
as a side note, the original app works just fine (even with the warnings)
weird isnt it??
|
|
|
|
|
I used ODBC "dBase files" to access a file GSTAT.DBF, my code is the following :
DBName = GlobalDSN + "Gstat;UID=;PWD:";
ErrMsg = "";
res = "SELECT DATUM,CASHT,MCASHT,NETROOM,MNETROOM from GSTAT WHERE (DATUM = #08/01/2004#)";
gDB.OpenEx(DBName,CDatabase::noOdbcDialog);
TRY
{
rs.Open( CRecordset::forwardOnly, res );
NbRecord = rs.GetRecordCount();
}
CATCH(CDBException, e)
....
The problem is that it works perfecly on the 1061 first records, but it refuses to find me the records 1062-1068 (1068 being the last record in file)... and I wonder why ?
I thought that it could be due to a problem with MSjet 4.0 dll because mine is quite "old" (as far as I can see, my version 4.0.4431.3 is from SP5.
I downloaded the SP8 from MS, but when I was to install it, I receive a message from the installation program saying that my version is too old and that I should have at least the SP3 ... Once again, I don't know why
Any idea on 1st or 2nd of my problem will be appreciated
DD
|
|
|
|
|
ok, i have found my 1st problem ... it is due to the wrong date format I passed in the WHERE clause, it must me in the US format (MM/DD/YYYY) and I was giving it in french format (DD/MM/YYYY) ...
So, I don't need to upgrade the MSJet stuff
Nevertheless, I would like to know if anyone has an idea on the strange message displayed by the prog supposed to upgrade MSJet ...
Regards
DD
|
|
|
|
|
who knows a good way to compile .asm files (like microsoft did with files like "memset.asm")?
thx for your answers,
Alexander M.
Don't try it, just do it!
|
|
|
|
|