Re: [Dev-C++] Problem with __asm statement
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Philip B. <phi...@pb...> - 2007-02-17 01:03:47
|
No, I did not request him to write assembly code and thus, I did not tell him what compiler I was using either. he compiled a test executable and I thought it was such a simple task and I had seen a working example as well as the code, so I paid him. It was a low price, because it is a simple function. I'm not sure where to go from here, I suppose I will have to hire someone to explissitly translate the thing because I don't have enough knowledge yet to do it myself. The section I pasted was only one of the two that there are all in total, although the second one is a bit longer but the same commands are repeated. Regards Philip Bennefall ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "Philip Bennefall" <phi...@pb...> Cc: <dev...@li...> Sent: Saturday, February 17, 2007 1:41 AM Subject: Re: [Dev-C++] Problem with __asm statement > Because asm isn't examply part of the c++ standard. > > The use of embedded assembler is a compiler-specific extension, and > different architectures and/or compilers can use different formats. > > VC uses the Intel standard for writing x86 assembly instructions. > > gcc uses the AT&T syntax. > > See http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s3 > > Different compilers also have different calling conventions, so even if > the assembly code is modified to the correct dialect, you can't be sure > that the two compilers uses the same registers or parameter passing > conventions. > > Did you request him to write in assembler? If you didn't specifically > requested it, then the delivery was not according to agreement. > > If you did request an assembler solution, then you should have specified > the target, i.e. processor, OS, compiler, ... > > /pwm > > On Sat, 17 Feb 2007, Philip Bennefall wrote: > >> Hello, >> >> A few days go I hired a person from Rent a coder to write me a couple of >> C++ functions. he was using Vc++ to develop his code as far as I know. >> Now, MinGW has problems compiling his code because of the fact that he is >> using assembly. One part of the code looks like: >> __asm { >> mov ebx, dwCardID >> add ebx, i >> xor eax,eax >> mov al, bTmp >> mov byte ptr [ebx],al >> } >> But it completely refuses to compile it. Can anyone tell me why? >> >> Thanks in advance. >> >> Regards >> Philip Bennefall > > |