Created
November 30, 2012 04:37
-
-
Save leopic/4173794 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; http://www.cin.ufpe.br/~if817/arquivos/asmtut/index.html#helloworld | |
; http://syscalls.kernelgrok.com/ | |
; hello world mas basico que encontre | |
section .data | |
msg: db 'Dar es dar y dar y dar y dar!',0xa ;el string que se va a imprimir | |
largo: equ $ - msg ;el largo del string | |
section .text | |
global _start ;must be declared for linker (ld) ??? | |
_start: ;tell linker entry point ??? | |
pop rbx; | |
pop rbx; | |
;mov msg, [rbx]; | |
mov ecx, msg ;movemos el string a ECX | |
mov edx, largo ;movemos el largo a EDX | |
; hacia donde vamos a salir | |
mov ebx, 1 ;file descriptor (stdout), salida en pantalla | |
; que funcion vamos a llamar | |
mov eax, 4 ;system call number (sys_write), vamos a salir | |
; KERNEL! espabilate | |
int 0x80 ;call kernel, KERNEEEL, esta es para vos | |
; funcion de salida | |
; le decimos que salimos con 0 | |
mov ebx, 0 | |
mov eax, 1 ;system call number (sys_exit) | |
; KENEL! te toca mae | |
int 0x80 ;call kernel, KERNEEEL, esta es para vos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment