Advertisement
Guest User

tincu

a guest
Nov 13th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. .model small
  2. .stack
  3. .data
  4. intro db 'Versiunea raportata de sistemul de operare este:$'
  5. tab db '0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15'
  6. .code
  7. start:
  8. mov ax,@data;15.00 - ax 00 15
  9. mov ds,ax
  10. mov dx,offset intro
  11. mov ah,09h
  12. int 21h
  13. mov ah,30h
  14. int 21h
  15.  
  16. push ax; protejam ah
  17. mov ah,0
  18. mov dx,0
  19. mov cx,0
  20. mov bx,10 ; dx:ax/bx
  21. descompunere:
  22. div bx
  23. push dx ; restul impartitri la 10h
  24. inc cx
  25. mov dx,0
  26. cmp ax,0
  27. jne descompunere
  28.  
  29. afisare:
  30. pop bx
  31. mov dl,byte ptr tab[bx]
  32. mov ah,02h
  33. int 21h
  34. loop afisare
  35.  
  36. mov dl,'.'
  37. mov ah,02h
  38. int 21h
  39.  
  40.  
  41. pop ax
  42. shr ax,8
  43.  
  44. mov ah,0
  45. mov dx,0
  46. mov cx,0
  47. mov bx,10 ; dx:ax/bx
  48. descompunere2:
  49. div bx
  50. push dx ; restul impartitri la 10h
  51. inc cx
  52. mov dx,0
  53. cmp ax,0
  54. jne descompunere2
  55.  
  56. afisare2:
  57. pop bx
  58. mov dl,byte ptr tab[bx]
  59. mov ah,02h
  60. int 21h
  61. loop afisare2
  62.  
  63. mov ah,4ch
  64. int 21h
  65. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement