fork(1) download
  1. section .bss
  2. msg resb 1 ; reserva 1 byte para um caractere
  3.  
  4. section .data
  5.  
  6. section .text
  7. global _start
  8.  
  9. _start:
  10. ; Lê 1 caractere do teclado
  11. mov eax, 3 ; sys_read
  12. mov ebx, 0 ; stdin
  13. mov ecx, msg ; onde armazenar
  14. mov edx, 5 ; quantos bytes
  15. int 0x80 ; chamada de sistema
  16. jmp trocar
  17.  
  18. trocar:
  19. mov al, [msg]
  20. or al, 32
  21. mov [msg], al
  22. jmp imprime_caractere
  23.  
  24. imprime_caractere:
  25. mov eax, 4 ; sys_write
  26. mov ebx, 1 ; stdout
  27. mov ecx, msg ; endereço da string
  28. mov edx, 5 ; tamanho da string (8 chars + newline)
  29. int 0x80 ; chamada de sistema
  30. jmp exit
  31.  
  32. exit:
  33. mov eax, 1 ; sys_exit
  34. mov ebx, 0
  35. int 0x80
Success #stdin #stdout 0s 5316KB
stdin
1
stdout
1