944,029 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 14110
  • C RSS
Apr 19th, 2005
0

Using Assembly Codes in Bloodshed Dev-CPP

Expand Post »
I am using BloodshedDev-CPP GNU. Assembly codes are written in this format :

int Variable=45; /*a random value*/
__asm(mov %ax,_Degisken);

The crap compiler uses 'AT&T Assembly Syntax'. The problem is I don't know that AT&T stuff and I want to call some interrupts in my program.
In the normal assambly language, interrupts are called with "int" keyword. But what about AT&T?
Similar Threads
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
AhmedHan is offline Offline
71 posts
since Apr 2005
Apr 19th, 2005
0

Re: Using Assembly Codes in Bloodshed Dev-CPP

>The crap compiler uses 'AT&T Assembly Syntax'.
Just because it uses an ASM syntax that you don't know doesn't mean that the compiler is crap. In fact, GNU GCC is a very good compiler that many experts recommend. Good first impression. :rolleyes:

>In the normal assambly language
There is no "normal" assembly language. Every architecture uses a different base assembly language, and every compiler that supports inline assembly uses its own variant.

>But what about AT&T?
Hmm, I don't know about everyone else, but I'm disinclined to help you after reading your derogatory and ignorant comments toward something you don't understand.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Apr 19th, 2005
0

Re: Using Assembly Codes in Bloodshed Dev-CPP

The differences are highlighted at this site: http://www.objsw.com/docs/as_196.html

Good luck!
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004
Apr 19th, 2005
0

Re: Using Assembly Codes in Bloodshed Dev-CPP

-masm=intel in the compiler options
Reputation Points: 14
Solved Threads: 4
Junior Poster
prog-bman is offline Offline
108 posts
since Nov 2004
May 11th, 2005
0

Re: Using Assembly Codes in Bloodshed Dev-CPP

I set this "-masm=intel" and then tried to compile this:

  1. void flipIt(void* buffer)
  2. {
  3. void* b = buffer;// Ukazatel na buffer
  4. __asm__ // ASM kód
  5. (
  6. "mov ecx, 256*256 \n\t"
  7. "mov ebx, b \n\t"
  8. "label: \n\t"
  9. "mov al, [ebx+0] \n\t"
  10. "mov ah, [ebx+2] \n\t"
  11. "mov [ebx+2], al \n\t"
  12. "mov [ebx+0], ah \n\t"
  13. "add ebx, 3 \n\t"
  14. "dec ecx \n\t"
  15. "jnz label \n\t"
  16. );
  17. }
<< moderator edit: added [code][/code] tags >>

The errors were:

Assembler messages:
Error: symbol `label' is already defined
Error: symbol `label' is already defined

I don't know what to do.
Thanks for help

typek
Reputation Points: 10
Solved Threads: 0
Newbie Poster
typek is offline Offline
7 posts
since May 2005
Jul 26th, 2005
0

Re: Using Assembly Codes in Bloodshed Dev-CPP

set "-masm=intel" and compile this:

  1. void flipIt(void* buffer)
  2. {
  3. static void* b asm("b") = buffer;// Ukazatel na buffer
  4. asm(// ASM kód
  5. "mov ecx, 256*256;"
  6. "mov ebx, b;"
  7. "label:;"
  8. "mov al, [ebx+0];"
  9. "mov ah, [ebx+2];"
  10. "mov [ebx+2], al;"
  11. "mov [ebx+0], ah;"
  12. "add ebx, 3;"
  13. "dec ecx;"
  14. "jnz label;"
  15. );
  16. }

AT&T does tend to suck. It hurts my eyes.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fluidDelusions is offline Offline
14 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Problems with linking OBJ files
Next Thread in C Forum Timeline: Fstream object questions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC