Advertisement
sylvieseal

Week 2

Feb 22nd, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. section .data
  2.  
  3. intro db 27,"[H",27,"[2J WELCOME TO THE QUIZ GAME",10,10,"Who is the greatest programmer of all time?",10,10," 1) Linus Torvolds",10," 2) Richard Stallman",10," 3) Terrance Davis",10,10,"Choose an answer (1,2,3): "
  4. introl equ $-intro
  5. ra db 27,"[H",27,"[2JYou have chosen the correct answer!",10,10
  6. ral equ $-ra
  7.  
  8. section .bss
  9.  
  10. choice resb 2
  11.  
  12. section .text
  13. global _start
  14. _start:
  15.  
  16. mov eax, 4
  17. mov ebx, 1
  18. mov ecx, intro
  19. mov edx, introl
  20. int 128
  21.  
  22. mov eax, 3
  23. inc ebx
  24. mov ecx, choice
  25. mov edx, 2
  26. int 128
  27.  
  28. cmp byte [choice], 51
  29. jne _start
  30.  
  31. mov eax, 4
  32. mov ebx, 1
  33. mov ecx, ra
  34. mov edx, ral
  35. int 128
  36.  
  37. mov eax, 1
  38. xor ebx, ebx
  39. int 128
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement