Ensamblador - Error moviendo el puntero de archivo

 
Vista:
sin imagen de perfil

Error moviendo el puntero de archivo

Publicado por Álvaro (1 intervención) el 23/12/2021 10:12:26
Intento mover el puntero de archivo una cierta distancia con un array en vez de con un valor directo en el registro ecx, pero no funciona como debería, el archivo creado no se carga y al salir me muestra el mensaje "Nano is out of memory", cuando pongo directamente el valor en el registro funciona perfectamente, por favor ayúdenme.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
section .data
        desp db 3
        file db '/home/alvaro/nasm/so1.asm', 0
        text db 'Text example'
        lon equ $-text
        text2 db 'Goodbye'
        lon2 equ $-text2
section .bss
        idfile resd 1
section .text
        global _start
_start:
        mov eax, 8
        mov ebx, file
        mov ecx, 0002h
        int 0x80
        cmp eax, 0
        jl _finalize
        mov dword[idfile], eax
_edit:
        mov eax, 4
        mov ebx, [idfile]
        mov ecx, text
        mov edx, lon
        int 0x80
_close:
        mov eax, 6
        mov ebx, idfile
        int 0x80
_open:
        mov eax, 5
        mov ebx, file
        mov ecx, 0002h
        int 0x80
_move:
        mov eax, 19
        mov ebx, [idfile]
        mov ecx, [desp]
        mov edx, 0
        int 0x80
_edit2:
        mov eax, 4
        mov ebx, [idfile]
        mov ecx, text2
        mov edx, lon2
        int 0x80
_close2:
        mov eax, 6
        mov ebx, idfile
        int 0x80
_finalize:
        mov eax, 1
        mov ebx, 0
        int 0x80
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder