error in backend: 32-bit absolute addressing is not supported in 64-bit mode

Viewed 6771

Hi I'm working on ASM intel_syntax noprefix on a mac using gcc, for some reason I keep getting this error in backend: 32-bit absolute addressing is not supported in 64-bit mode Does this has to do with the variables, at the moment is been use on the ASM inline?

here's my code:

#include <stdio.h>

char c, b;

int main() {

    printf("Give me letter: ");
    scanf(" %c", &c);

_

    _asm(   ".intel_syntax noprefix;"
        "xor eax, eax;"     // clear eax
        "mov al, byte ptr [c];" // save c in eax
        "cmp eax, 65;"      // eax ? "A"
        "jl Fin;"       // eax < "A" -> Fin
        "cmp eax, 90;"      // eax ? "Z"
        "jg UpC;"       // eax >= Z -> Up Case
        "add eax, 32;"      // make low case
        "jmp Fin;"      // -> Fin   
    "UpC:   cmp eax, 97;"       // eax ? "a"
        "jl Fin;"       // eax < "a" -> Fin
        "cmp eax, 122;"     // eax ? "z"
        "jg Fin;"       // eax > "z" -> Fin
        "sub eax, 32;"      // make Up Case
    "Fin:   mov byte ptr [b], al;"  // save res in b
        ".att_syntax");

    printf("Case changed : %c\n", b);
}
1 Answers
Related