Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Conditie, Sa se calcleze suma de la
- ;-8 pana la 10 apoi rezulatul sa-l
- ;inmulteasca cu 2
- .model small
- .stack
- .data
- s db 6 dup (?),'$'
- .code
- mov ax,@data
- mov ds,ax
- mov cx,18 ;programul o sa
- mov ax,0 ;faca 18 ciclari
- mov bx,-8 ;de la -8
- sum: add ax,bx ;facem suma
- inc bx ;incermentam cu 1
- loop sum ;ciclarea
- mov bx,2
- mul bx ;inmulti rez. cu 2
- push ax
- mov si,10
- mov di,5
- mov dx,0
- cmp ax,0
- jge m
- neg ax
- m:div si
- add dl,30h
- mov s[di], dl
- xor dx,dx
- dec di
- cmp ax,0
- jne m
- pop ax
- cmp ax,0
- jge m1
- mov s[di], '-'
- m1: mov ah,9
- lea dx,s
- int 21h
- mov ah,1
- int 21h
- mov ah,4ch
- int 21h
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement