Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. ;Conditie, Sa se calcleze suma de la
  2. ;-8 pana la 10 apoi rezulatul sa-l
  3. ;inmulteasca cu 2
  4. .model small
  5. .stack
  6. .data
  7. s db 6 dup (?),'$'
  8. .code
  9. mov ax,@data
  10. mov ds,ax
  11. mov cx,18 ;programul o sa
  12. mov ax,0 ;faca 18 ciclari
  13. mov bx,-8 ;de la -8
  14. sum: add ax,bx ;facem suma
  15. inc bx ;incermentam cu 1
  16. loop sum ;ciclarea
  17. mov bx,2
  18. mul bx ;inmulti rez. cu 2
  19.  
  20. push ax
  21. mov si,10
  22. mov di,5
  23. mov dx,0
  24. cmp ax,0
  25. jge m
  26. neg ax
  27. m:div si
  28. add dl,30h
  29. mov s[di], dl
  30. xor dx,dx
  31. dec di
  32. cmp ax,0
  33. jne m
  34. pop ax
  35. cmp ax,0
  36. jge m1
  37. mov s[di], '-'
  38. m1: mov ah,9
  39. lea dx,s
  40. int 21h
  41. mov ah,1
  42. int 21h
  43. mov ah,4ch
  44. int 21h
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement