Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Inline Assembly with Win32 (passing values?)
Hopefully this will be a simple answer. I've just never done this before.
I'd like to add a small amount of assembly coding to a Win32 (9x) program I'm building with Borland OWL C++ 4.52. I'm not familiar with passing data back. I found some code from Stober in the archives and tried to extrapolate it for my use as shown below. Will variable "a" hold the coded value when the function below returns? Do I need to concern myself with pushing and popping registers to keep from corrupting the program or is that taken care of by the normal function operations? I'm more familiar with 16 bit registers from long ago. Will 32 bit registers add any facet I should be aware of?
Does this look like I'm headed in the right direction:
void TXXWindow::function(int &a)
mov ecx,dword ptr [a]
mov eax,dword ptr [ecx]
. . .
code operations via eax register
. . .
mov dword ptr [ecx],eax
Sorry for all the questions. Thanks for any help.