diff --git a/curso/exemplos/05/salve.asm b/curso/exemplos/05/salve.asm new file mode 100644 index 0000000..feb3e6e --- /dev/null +++ b/curso/exemplos/05/salve.asm @@ -0,0 +1,17 @@ +section .rodata + msg db "Salve, simpatia!", 10 + len equ $ - msg + +section .text + global _start + +_start: + mov rax, 1 ; syscall write + mov rdi, 1 ; stdout + mov rsi, msg + mov rdx, len + syscall + + mov rax, 60 ; syscall exit + mov rdi, 0 ; código de saída 0 + syscall diff --git a/curso/exemplos/05/soma.c b/curso/exemplos/05/soma.c new file mode 100644 index 0000000..d293e32 --- /dev/null +++ b/curso/exemplos/05/soma.c @@ -0,0 +1,13 @@ +#include + +int soma(int a, int b) { + return a + b; +} + +int main() { + int x = 10; + int y = 20; + int r = soma(x, y); + printf("Soma: %d\n", r); + return 0; +}