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?

Recommended Answers

All 5 Replies

>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.

-masm=intel in the compiler options

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

void flipIt(void* buffer)
{
    void* b = buffer;// Ukazatel na buffer
    __asm__ // ASM kód
    (
        "mov ecx, 256*256 \n\t"
        "mov ebx, b \n\t"
        "label: \n\t"
        "mov al, [ebx+0] \n\t"
        "mov ah, [ebx+2] \n\t"
        "mov [ebx+2], al \n\t"
        "mov [ebx+0], ah \n\t"
        "add ebx, 3 \n\t"
        "dec ecx \n\t"
        "jnz label \n\t"
    );
}

<< 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

set "-masm=intel" and compile this:

void flipIt(void* buffer)
{
    static void* b asm("b")  = buffer;// Ukazatel na buffer
    asm(// ASM kód
        "mov ecx, 256*256;"
        "mov ebx, b;"
        "label:;"
        "mov al, [ebx+0];"
        "mov ah, [ebx+2];"
        "mov [ebx+2], al;"
        "mov [ebx+0], ah;"
        "add ebx, 3;"
        "dec ecx;"
        "jnz label;"
    );
}

AT&T does tend to suck. It hurts my eyes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.