From 348e041ff9b5c68da188c1ae5805d00f8809297d Mon Sep 17 00:00:00 2001 From: Blau Araujo Date: Wed, 14 May 2025 11:42:35 -0300 Subject: [PATCH] primeiro exemplo --- curso/aula-01.org | 2 +- curso/exemplos/01/exit42.asm | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 curso/exemplos/01/exit42.asm 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