Advertisement
qberik

лаба 4 задание 2

Dec 22nd, 2022
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. menu db '1 - Print Hello', 13,10
  5. db '2 - Print message', 13, 10
  6. db '3 - Exit prorgamm', 13,10, '$'
  7. select db 13,10, 'Select task >$'
  8. hello db 13, 10, 'Hello world!', 13,10,13,10, '$'
  9. go_away db 13,10, 'I like apples', 13, 10, 13, 10, '$'
  10. .code
  11. start:
  12. mov ax, @data
  13. mov ds, ax
  14. mov ah, 09h
  15. mov dx, offset menu
  16. int 21h
  17. _select_loop:
  18. mov ah, 09h
  19. mov dx, offset select
  20. int 21h
  21. mov ah, 01h
  22. int 21h
  23. cmp al, '1'
  24. je _c1
  25. cmp al, '2'
  26. je _c2
  27. cmp al, '3'
  28. je _exit
  29. jmp _select_loop
  30. _c1:
  31. mov ah, 09h
  32. mov dx, offset hello
  33. int 21h
  34. jmp start
  35. _c2:
  36. mov ah, 09h
  37. mov dx, offset go_away
  38. int 21h
  39. jmp start
  40. _exit:
  41. mov ax, 4c00h
  42. int 21h
  43. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement