Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- .stack 100h
- .data
- .code
- onem macro x
- push ax ; cz AX mirjafor! value chng kore dey -_-
- mov dx,x ;dl dile 8 bit er sthe 16 bit korte jabe! SO ERROR , tai amra eikhne DL na diye DX disi
- mov ah,2
- add dl,'0'
- int 21h
- pop ax
- endm onem
- main proc
- mov dx, @data
- mov ds, dx
- mov ax, 12345
- call printAX
- mov ah,4ch
- int 21h
- endp main
- printAX proc
- mov bx,10
- count db 0
- L1:
- mov bx,10
- xor dx, dx
- div bx ; DX = AX % 10, AX = AX/10
- push dx
- inc count
- cmp ax,0
- je L2
- jmp L1
- L2:
- dec count
- pop dx
- onem dx
- cmp count,0
- je done
- jmp L2
- done:
- ret
- endm printAX
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement