| View previous topic :: View next topic |
| Author |
Message |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 04, 2008 8:55 am Post subject: [ERROR] __asm and Dev-C++ |
|
|
Whenever I try to compile something (DLL) in my favorite compiler, Dev-C++, I get errors when I use __asm. Here is the line that gets the errors:
| Code: |
__asm mov byte ptr ds:[0x12345678],0x90
|
Here is the error:
| Code: |
Compiler: Default compiler
Building Makefile: "C:\ ... \Makefile.win"
Executing make...
make.exe -f "C:\ ... \Makefile.win" all
g++.exe -c dllmain.cpp -o dllmain.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -DBUILDING_DLL=1
dllmain.cpp: In function `bool DllMain()':
dllmain.cpp:13: error: expected `(' before "mov"
dllmain.cpp:13: error: expected asm body before "mov"
dllmain.cpp:13: error: `mov' undeclared (first use this function)
dllmain.cpp:13: error: (Each undeclared identifier is reported only once for each function it appears in.)
dllmain.cpp:13: error: expected `;' before "byte"
make.exe: *** [dllmain.o] Error 1
Execution terminated
|
Nothing to helpful there... I am using 'windows.h' include file. Is the __asm function in another? Or is it the compiler?
TY!
|
|
| Back to top |
|
 |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 04, 2008 8:59 am Post subject: |
|
|
| Yeah, I know. But are you saying that __asm is only for microsofts compiler? Because __asm becomes bolded in Dev-C++...
|
|
| Back to top |
|
 |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
Posted: Fri Jul 04, 2008 9:02 am Post subject: |
|
|
i have no expperience handling GCC compiler before, I assume you have to do them like this :
| Code: |
__asm__ ("movl %eax, %ebx\n\t"
"movl $56, %esi\n\t"
"movl %ecx, $label(%edx,%ebx,$4)\n\t"
"movb %ah, (%ebx)"
);
|
taken from GCC-Inline-Assembly-Howto
Edited.
_________________
I wanna hack, but I don't know how... |
|
| Back to top |
|
 |
MegaForum Grandmaster Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 558
|
Posted: Fri Jul 04, 2008 9:04 am Post subject: |
|
|
| Use Visual C++ 2008 from microsoft. Best compiler around I think atm.
|
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 04, 2008 9:07 am Post subject: |
|
|
I get it... I remember reading about that in my programming book. =)
And I hate microsoft, but sometimes you do need to use their stuff. But I like to go oldschool and not use the drag and drop stuff in microsofts compilers. =) But sometimes it is helpful...
|
|
| Back to top |
|
 |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 04, 2008 9:18 am Post subject: |
|
|
| Yeah, I use it on kubuntu. And I find the AT&T asm too hard to pick up, I am just going to use VC++ 2005. (They messed up 2008)
|
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Fri Jul 04, 2008 10:20 am Post subject: |
|
|
Under dev-cpp compiler options, go to "Ad the following commands when calling comiler" and put -masm=intel so you can use intel syntax instead of at&t.
Alos, it's just asm(), not __asm{}.
asm(mov [0x134643], 0x90); might work. for what you have, but there's no point in using ASM for that. (BYTE)*(0x265216) = 0x90.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Jul 04, 2008 11:42 am Post subject: |
|
|
See, Dev-C++ is outdated, and is buggy, and not as intelligent. Microsoft Visual C++ Express Edition 2008 (yes I used the full name) is up to date, not buggy, intelligent, and has extra features to help you design as well as create your programs. It also has more options.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|