exemplos da aula 5

This commit is contained in:
Blau Araujo 2025-05-22 14:16:05 -03:00
parent 7df3f44f24
commit 0f2dad4b0c
2 changed files with 30 additions and 0 deletions

View file

@ -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

13
curso/exemplos/05/soma.c Normal file
View file

@ -0,0 +1,13 @@
#include <stdio.h>
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;
}