Guest User

Untitled

a guest
Jun 7th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 100h
  3. .data
  4.     a dw 42
  5.     b dw 24
  6.     r dw ?    
  7. .code
  8. start:
  9.     mov ax,@data
  10.     mov ds,ax
  11.    
  12.     afla:
  13.         ; cmp b,0
  14.         ;je afisare
  15.         mov bx,b
  16.         mov r,bx
  17.         mov ax,a
  18.         div bx
  19.         mov b,dx
  20.     cmp dx,0
  21.     je afisare 
  22.     xor dx,dx
  23.         mov ax,r
  24.         mov a,ax
  25.         jmp afla
  26.  
  27.        
  28.     afisare:
  29.     mov ax,bx
  30.         mov bx,25
  31.         push bx
  32.         divide:
  33.             mov dx,0
  34.             mov cx,10
  35.             div cx
  36.             push dx
  37.         cmp ax,0
  38.         je egal_zero
  39.         jmp divide
  40.     egal_zero:
  41.         mov ah,2
  42.         pop dx
  43.         cmp dx,25
  44.         je stop
  45.         add dx,30h
  46.         int 21h
  47.         loop egal_zero
  48.     stop:
  49.         mov ax,4c00h
  50.         int 21h
  51. end start
Add Comment
Please, Sign In to add comment