Advertisement
Guest User

Untitled

a guest
Nov 21st, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. deci    SEGMENT
  2.         ASSUME    cs:deci, es: deci, ds: deci, ss: deci
  3.         ORG    100h
  4. start:
  5.         call entery
  6.  
  7.         mov ax, 0
  8.         mov al, 59
  9.         mov cl, 10
  10.        
  11.         div cl ; remainder in AH, quotient in AL 59 / 10 == 5 * 10 + (9) -> 5 / 10 == 0 * 10 + (5) <- ah
  12.        
  13.        
  14.  
  15.         mov bh, ah
  16.         mov bl, al
  17.         add bh, 48              ; liczba jednostek
  18.         push bx
  19.         mov al, 0
  20.         cmp al, 0                                   ; Z = 1, gdy wynik arg1 - arg2 == 0 (cmp arg1, arg 2)
  21.        
  22.        
  23.     ;   mov ax, 0
  24.     ;   mov ah, 0Eh
  25.     ;   mov al, bh
  26.     ;   int 10h
  27.        
  28.         mov ax, 0
  29.         mov al, bl  ; taking quotient to al
  30.        
  31.         div cl
  32.        
  33.         mov bh, ah
  34.         add bh, 48              ; liczba dziesiątek
  35.         push bx
  36.        
  37.         ; ******************
  38.         ;
  39.         ;   AH -> remainder
  40.         ;   AL -> QUOTIENT
  41.         ;
  42.         ; ******************
  43.         mov bp, sp
  44.        
  45.         mov ax, 0
  46.         mov ah, 0Eh
  47.         mov al, [bp+1]
  48.         int 10h
  49.        
  50.         mov ax, 0
  51.         mov ah, 0Eh
  52.         mov al, [bp+3]
  53.         int 10h
  54.        
  55.        
  56.        
  57.        
  58.        
  59.        
  60.        
  61.         mov ax, 0
  62.         mov ah, 4Ch
  63.         mov al, 0
  64.         int 21h
  65.        
  66.        
  67.        
  68. entery  PROC
  69.         push ax
  70.        
  71.         mov ah, 0Eh
  72.         mov al, 10
  73.         int 10h
  74.        
  75.         mov ah, 0Eh
  76.         mov al, 13
  77.         int 10h
  78.        
  79.         pop ax
  80.  
  81.         ret
  82. entery ENDP
  83. deci    ENDS
  84.         END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement