Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WriteInteger proc
- push ax
- push cx
- push bx
- push dx
- xor cx, cx
- mov bx, 10
- cmp ax, 0
- jl ddd
- jmp divl
- ddd:
- push ax
- mov dl, '-'
- mov ah, 2
- int 21h
- pop ax
- neg ax
- divl:
- xor dx, dx
- idiv bx
- push dx
- inc cx
- cmp ax,0
- jg divl
- popl:
- pop ax
- add al, '0'
- call WriteChar
- loop popl
- pop dx
- pop bx
- pop cx
- pop ax
- ret
- WriteInteger endp
- WriteChar proc
- push ax
- push dx
- mov dl, al
- mov ah, 2
- int 21h
- pop dx
- pop ax
- ret
- WriteChar endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement