diff --git a/curso/aula-01.org b/curso/aula-01.org index 471fe1a..1463bd5 100644 --- a/curso/aula-01.org +++ b/curso/aula-01.org @@ -270,7 +270,7 @@ a =R15=. * Primeiro exemplo em Assembly x86_64 -#+begin_src asm +#+begin_src asm :tangle exemplos/01/exit42.asm ; Retorna 42 como estado de término section .text diff --git a/curso/exemplos/01/exit42.asm b/curso/exemplos/01/exit42.asm new file mode 100644 index 0000000..f7a7152 --- /dev/null +++ b/curso/exemplos/01/exit42.asm @@ -0,0 +1,9 @@ +; Retorna 42 como estado de término + +section .text + global _start + +_start: + mov rax, 60 ; syscall: exit + mov rdi, 42 ; código de saída + syscall