DCPU16 25
[COAL] Division Guest on 4th December 2020 01:13:18 PM
  1. .model small
  2. .stack 100h
  3. .data
  4. str1 db 10,13,'Quotient=','$'
  5. str2 db 'Reminder=$'
  6. .code
  7. main proc
  8.     mov ax,@data
  9.     mov ds,ax
  10.     mov ax,30 ;; divident
  11.     mov bl,7  ; divisor
  12.     div bl
  13.     mov ch,ah
  14.     mov cl,al
  15.     lea dx,str2
  16.     mov ah,9
  17.     int 21h
  18.    
  19.     mov dl,ch
  20.     add dl,48
  21.     mov ah,2
  22.     int 21h
  23.    
  24.     lea dx,str1
  25.     mov ah,9
  26.     int 21h
  27.    
  28.     mov dl,cl
  29.     add dl,48
  30.     mov ah,2
  31.     int 21h
  32.    
  33.     mov ah,4ch
  34.     int 21h
  35.      
  36.     main endp
  37. end main

Coding Base is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.