Сборка: ..расположение усечено, чтобы соответствовать

Используя сборку Linux x86 и синтаксис AT&T, я хотел бы создать программу, которая для максимального времени печатает счетчик этого цикла. Я пытался с этим:

.data

.text

.global main

diff    =   48
max     =   5   

count:  .byte   0
p:      .byte   0

main:

compare:
    movb    $count,%al
    cmp     $max,%al
    jnb     end

    movl    $4,%eax
    movl    $1,%ebx
    xor     %ecx,%ecx
    addb    $diff,%cl
    addb    $count,%cl
    movb    %cl,p
    movb    $p,%cl
    movl    $1,%edx
    int     $0x80

    movb    $count,%al
    inc     %al
    movb    %al,count
    jmp     compare

end:
    movl    $1,%eax
    movl    $0,%ebx
    int     $0x80

Но GCC дает мне эти ошибки:

/tmp/ccqobwxL.o: In function `compare':
(.text+0x3): relocation truncated to fit: R_386_8 against `.text'
/tmp/ccqobwxL.o: In function `compare':
(.text+0x19): relocation truncated to fit: R_386_8 against `.text'
/tmp/ccqobwxL.o: In function `compare':
(.text+0x21): relocation truncated to fit: R_386_8 against `.text'
/tmp/ccqobwxL.o: In function `compare':
(.text+0x2a): relocation truncated to fit: R_386_8 against `.text'
collect2: error: ld returned 1 exit status

Какие проблемы и как я могу их исправить?

0 ответов

Другие вопросы по тегам