Advertisement
SquirrelInBox

Untitled

May 6th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. LOCALS
  2. .model tiny
  3. .code
  4. .386
  5. org 100h
  6.  
  7. START:
  8.  
  9. jmp main
  10. print_symb proc
  11. ; в dl символ
  12. pusha
  13. mov ah, 02h
  14. int 21h
  15. popa
  16.  
  17. ret
  18. print_symb endp
  19.  
  20. write_num proc
  21. pusha
  22. push -1
  23. mov bx, 10h
  24. mov cx, 0002h
  25. xor dx, dx
  26. @@loop1:
  27. div bl
  28. xor al, al
  29. push ax
  30. dec cx
  31. cmp cx, 0
  32. jne @@loop1
  33.  
  34. mov cx, 0002h
  35. xor dx, dx
  36. @@loop:
  37. pop dx
  38. cmp dx, -1
  39. je @@end
  40.  
  41. cmp dh, 0ah
  42. jge @@more
  43.  
  44. add dh, 30h
  45. jmp @@write
  46. @@more:
  47. add dh, 37h
  48.  
  49. @@write:
  50. mov ah, 02h
  51. mov dl, dh
  52. int 21h
  53. jmp @@loop
  54. @@end:
  55. popa
  56. ret
  57. write_num endp
  58.  
  59.  
  60. write_tab proc
  61. pusha
  62.  
  63. mov ah, 02h
  64. mov dl, 09h
  65. int 21h
  66.  
  67. popa
  68. ret
  69. write_tab endp
  70.  
  71. write_new_line proc
  72. pusha
  73. mov dl, 0ah
  74. call print_symb
  75. mov dl, 0dh
  76. call print_symb
  77. popa
  78. ret
  79. write_new_line endp
  80.  
  81. main:
  82.  
  83. mov ah, 09h
  84. lea dx, header
  85. int 21h
  86.  
  87. new_iter:
  88. mov ah, 00h
  89. int 16h
  90.  
  91. ; ESC code
  92. mov bx, 011bh
  93. cmp ax, bx
  94. je @@end
  95.  
  96. call write_new_line
  97. call write_tab
  98.  
  99. mov bx, ax
  100. xchg ah, al
  101. xor ah, ah
  102. call write_num
  103.  
  104. call write_tab
  105. call write_tab
  106.  
  107. mov ax, bx
  108. xor ah, ah
  109. call write_num
  110.  
  111. jmp new_iter
  112.  
  113. @@end:
  114. ret
  115.  
  116. header db " ASCII-code SCAN-code Symbol", "$"
  117.  
  118. end START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement