All pastes #2095093 Raw Edit

primer intento

public text v1 · immutable
#2095093 ·published 2011-11-23 22:43 UTC
rendered paste body
                                                                                                                                                     
section .data                                                                                                                                        
        ayuda_linea1   db  'Copyright (C) 2011.',18                                                                                                  
        ayuda_lineaGPL db  'This is free software and may be redistributed under the terms of the GNU GPL.',77                                       
        ayuda_modoUso  db  'Modo de uso: enum [-h] [ archivo_entrada | archivo_entrada archivo_salida]',73                                           
                                                                                                                                                     

section .bss

section .text
        global _start                   ; Inicio de programa
        global _exit_normal             ; Salida sin errores
        global _exit_error_input        ; Salida anormal por error en el archivo de entrada
        global _exit_error_output       ; Salida anormal por error en el archivo de salida
        global _exit_error_other        ; Salida anormal por error no especificado

        _start:
                mov eax, 4              ;servicio sys_write
                mov ebx, 1              ;standard output
                mov ecx, ayuda_linea1   ;offset de mensaje
                int 80h                 ;invocacion al servicio
                jmp _exit_normal


        _exit_normal:
                mov eax, 1              ; servicio sys_exit
                mov ebx, 0              ; terminacion sin errores
                int 80h                 ; invocacion al servicio

        _exit_error_input:
                mov eax, 1              ; servicio sys_exit
                mov ebx, 1              ; Salida anormal por error en el archivo de entrada
                int 80h                 ; invocacion al servicio

        _exit_error_output:
                mov eax, 1              ; servicio sys_exit
                mov ebx, 2              ; Salida anormal por error en el archivo de salida
                int 80h                 ; invocacion al servicio

        _exit_error_other:
                mov eax, 1              ; servicio sys_exit
                mov ebx, 3              ; Salida anormal por error no especificado
                int 80h                 ; invocacion al servicio





section .stack