Using Assembly Codes in Bloodshed Dev-CPP

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2005
Posts: 71
Reputation: AhmedHan is an unknown quantity at this point 
Solved Threads: 1
AhmedHan's Avatar
AhmedHan AhmedHan is offline Offline
Junior Poster in Training

Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #1
Apr 19th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,848
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 754
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #2
Apr 19th, 2005
>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.
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #3
Apr 19th, 2005
The differences are highlighted at this site: http://www.objsw.com/docs/as_196.html

Good luck!
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 108
Reputation: prog-bman is an unknown quantity at this point 
Solved Threads: 3
prog-bman prog-bman is offline Offline
Junior Poster

Re: Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #4
Apr 19th, 2005
-masm=intel in the compiler options
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++

Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 7
Reputation: typek is an unknown quantity at this point 
Solved Threads: 0
typek typek is offline Offline
Newbie Poster

Re: Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #5
May 11th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 14
Reputation: fluidDelusions is an unknown quantity at this point 
Solved Threads: 0
fluidDelusions fluidDelusions is offline Offline
Newbie Poster

Re: Using Assembly Codes in Bloodshed Dev-CPP

 
0
  #6
Jul 26th, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum


Views: 10482 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC