section .data len equ 1024 dif equ 'a' - 'A' section .bss buf resb len section .text global _start _start: ;le a string de stdin mov edx, len mov ecx, buf mov ebx, 0 mov eax, 3 int 0x80 ;converte para maiusculas mov ecx, eax ;eax guardou o valor de retorno da funcao sys_read mov edx, eax ;vamos usar edx para preservar esse valor inicio_do_laco: mov ebx, ecx neg ebx mov ah, [buf+ebx] cmp ah, 'a' jb proximo cmp ah, 'z' ja proximo sub ah, dif mov [buf+ebx], ah proximo: loop inicio_do_laco ;escreve a string em stdout ;edx ja esta com o valor certo do terceiro argumento mov ecx, buf mov ebx, 1 mov eax, 4 int 0x80 ;e sai do programa mov ebx, 0 mov eax, 1 int 0x80