Advertisement
tsnaik

MFP lab9

Sep 20th, 2015
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1. divide by 0 int
  2.  
  3.  
  4. ;file1.asm--------------------------------
  5. public  str1
  6.  
  7.     extrn DIVERROR : Far
  8.    
  9.     Data Segment
  10.         str1 db 'We can not do this $'
  11.        
  12.     Data Ends
  13.    
  14.     Code Segment
  15.    
  16.         assume cs:code ,ds:data
  17.         mov ax,data
  18.         mov ds,ax
  19.         xor ax,ax  
  20.        
  21.         mov ax,0
  22.         mov es,ax
  23.        
  24.         mov word ptr es:0000 ,offset DIVERROR
  25.         mov word ptr es:0002 ,SEG DIVERROR
  26.        
  27.         mov ax,10
  28.         mov bl,0
  29.         DIV bl
  30.         int 3h
  31.     Code Ends
  32.     End
  33.          
  34.  
  35.  
  36.  
  37. ;file2------------------------------------------
  38.  
  39. extrn str1: Byte
  40. public DIVERROR
  41.  
  42. c4 segment
  43.     assume cs:c4
  44.     DIVERROR proc far
  45.    
  46.     lea dx, str1
  47.     mov ah,09h
  48.     int 21h
  49.     mov bl,10
  50.     Iret
  51.    
  52.     DIVERROR Endp
  53. c4 Ends
  54. End
  55.  
  56.  
  57. 2. overflow int
  58. 3. implement a macro which will evaluate nCr and include the macro using include.h file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement