Компиля сие чудо былодкода
.data
.set MAXLEN, 80
//.set MAX
.set ZERO, 0
hlp1:
.string "Enter input string\n"
.set hlp1_len, . - hlp1 - 1
in1str:
.space MAXLEN
in1str_len:
.short MAXLEN
outstr:
.space MAXLEN
i:
.byte ZERO
N:
.byte ZERO
buffer:
.space 80
.text
.globl main
.type main, @function
main:
mov $4, %eax
mov $1, %ebx
mov $hlp1, %ecx
//output message(hlp) string
mov $hlp1_len, %edx
int $0x80
mov $3, %eax
mov $MAXLEN,%edx
mov $in1str,%ecx
//input work string
mov $0,%ebx
int $0x80
movl %eax,(in1str_len)
movl $in1str, %eax
mov $4,%eax
mov $1,%ebx
mov $in1str,%ecx
mov $in1str_len,%edx
int $0x80
mov $0,%esi
mov $0,%edi
mov $0,%ebx
while1:
lea in1str(,%esi),%ecx
movb (%ecx),%al
movb %al, outstr(%ebx,%edi)
cmp ';',%al
je label1
cmp ',',%al
je label1
cmp '.',%al
je label1
inc %si
inc %di
jmp label1exit
label1:
movw $0,%di
movw (i),%di
add $78,%di
movb $13,outstr(,%edi)
// как записать в перемнную?!
inc %di
movb $10,outstr(,%edi)
movw $0,%ax
movw $0,%di
inc %si
add $80,%bx
label1exit:
cmp $in1str_len,%si
jne while1
movw %bx,%ax
movb $MAXLEN,%cl
div %cl
movl $0,%ecx
movw %bx,%cx
movw %bx,(N)
external:
movb $0,(i)
push %cx
movw (N),%cx
dec %cx
internal:
movw (i),%si
lea outstr(,%esi), %bx
movb (%bx), %al
add $80,%si
movw $0,%bx
lea outstr(,%esi),%bx
movb (%bx),%dl
sub $80,%si
cmp %dl,%al
jnb label2
jmp label2exit
label2:
cld
add $80,%si
lea outstr(,%esi), %si
lea buffer, %di
push %cx
movw $80,%cx
rep movsb
pop %cx
movw (i), %si
movw %si,%di
add $80,%di
lea outstr(,%esi), %si
lea outstr(,%edi), %di
push %cx
movw $80,%cx
rep movsb
pop %cx
movw (i),%di
lea buffer,%si
lea outstr(,%edi), %di
push %cx
movw $80,%cx
rep movsb
pop %cx
label2exit:
movw (i), %ax
add $80,%ax
movw %ax,(i)
cmpw $0,%cx
jne internal
pop %cx
cmpw $0,%cx
jne external
movl $1, %eax
movl $0, %ebx
int $0x80
[/code ]
/tmp/ccm1x2Ci.o: In function `label1exit':
(.text+0xbb): relocation truncated to fit: R_386_16 against `.data'
collect2: ld returned 1 exit status
Получаю следующую ошибку