Skip to content

Instantly share code, notes, and snippets.

@ageekymonk
Created August 7, 2011 07:33
Show Gist options
  • Save ageekymonk/1130159 to your computer and use it in GitHub Desktop.
Save ageekymonk/1130159 to your computer and use it in GitHub Desktop.
x86 Assembly
.section .data
hello:
.ascii "Diving into Great Assembly World"
hello_end:
.set HELLO_SIZE, hello_end-hello
.section .text
.global _start
_start:
movl $4,%eax /* sys_write */
movl $1,%ebx /* Arg1 - file descriptor - 1(stdout) */
leal hello,%ecx /* Arg2 - mem address */
movl $HELLO_SIZE,%edx /* Arg3 - size */
int $0x80 /* call the system call */
movl $1,%eax /* sys_exit */
movl $0,%ebx /* Arg1 - status */
int $0x80 /* call the system call */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment