Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 10h
  3. .data
  4.  
  5.  
  6.     STR1    DB  "45","$"
  7.     COUNTSYM    DW  (?)
  8.     NUMBER      DB  (?)
  9.     he                     db    (?)
  10.     temp DB             2     dup(" "),"$"
  11. .code
  12. assume ss:@stack ,cs:@code ,ds:@data
  13. push ds
  14. push 0
  15. push @data
  16. pop  ds
  17. push ds
  18. pop es
  19.  
  20. begin:
  21. .386
  22. mov ax,53
  23. call IntToStr
  24. mov ah,0
  25. mov ah , 09h
  26. lea   dx,temp
  27. int 21h
  28.  
  29. IntToStr proc
  30.  push cx
  31.  push dx
  32.  push di
  33.  push ax
  34.  mov cx,3
  35. lea SI,temp
  36. FILL_BUF_:
  37. mov byte ptr [si],' '
  38.  inc si
  39.  LOOP FILL_BUF_
  40.  mov [si+1],'$'
  41.  mov di,10
  42.  or ax,ax
  43.  jns CLR_DVD_
  44.  neg ax
  45. CLR_DVD_:
  46.  xor dx,dx
  47.  div di
  48.  add dx,'0'
  49.  dec si
  50.  mov byte ptr [si],dl
  51.  dec cx
  52.  or ax,ax
  53.  jnz CLR_DVD_
  54.  
  55.  pop ax
  56.  or ax,ax
  57.  jns NOMORE_
  58.  dec si
  59.  mov byte ptr [si],'-'
  60.  inc cx
  61. NOMORE_:
  62.  pop di
  63.  pop dx
  64.  pop cx
  65.  ret
  66. IntToStr endp
  67.  
  68.  
  69. MOV     AH, 4Ch     ;завершаем программу с помощью
  70. INT     21h         ;функции 4c прерывания 21h
  71. end begin
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement