fork(9) download
  1. GLOBAL _start
  2. SEGMENT .text
  3. _start:
  4. mov eax,4 ; N function=write
  5. mov ebx,1 ; N handle=1 (stdout)
  6. mov ecx, txt ; address of buf
  7. mov edx,16 ; number of byte
  8. int 80h
  9.  
  10. mov eax,3 ; N function=read
  11. mov ebx,0 ; 0 handle=0 (stdin)
  12. mov ecx, buf ; address of buf
  13. mov edx,80 ; number of byte
  14. int 80h
  15.  
  16. mov [len],eax ;save length buf
  17. mov byte [buf+1],'!'
  18.  
  19. mov eax,4 ; N function=write
  20. mov ebx,1 ; N handle=1 (stdout)
  21. mov ecx, buf ; address of buf
  22. mov edx,[len] ; number of byte
  23. int 80h
  24.  
  25. mov eax,1 ; function=exit
  26. int 80h
  27.  
  28. SEGMENT .data
  29. buf times 80 db 0 ;
  30. len dd 0
  31. txt db 'Enter the text '
Runtime error #stdin #stdout 0.01s 144KB
stdin
Standard input is empty
stdout
Enter the text