madhawaseeeee

final2

Sep 23rd, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL  SMALL     ; use small memory model
  2. .STACK  100H      ; reserves 100h bytes for stack
  3. .CODE             ; starts code segment
  4.  
  5. START:  
  6.     ;set nic 1st (A) , 2nd (B) , 3rd (C) numbers to AL,BL,CL registers
  7.     MOV AL, 5
  8.     MOV BL, 5
  9.     MOV CL, 0
  10.    
  11. FINDX:
  12.     ; evaluate X = C * A
  13.     MUL CL       ; multiply CL by AL : C*A
  14.     MOV DL, AL   ; save result to DL
  15.  
  16. RESETXY:
  17.     MOV AL, 5    ; reset AL back to 5
  18.  
  19. FINDY:
  20.     ;evaluate Y = (A+B) OR C
  21.     ADD AL, BL   ;add AL(A) and BL(B) : (A+B)
  22.     OR  AL, CL   ;or AL(A) and CL(C) : (A+B) OR C
  23.  
  24. OPTABLE:
  25.     XOR DL, AL   ;XOR DL(x) and AL : X XOR Y
  26.     SHL DL,1     ;shift result by 1 bit
  27.  
  28. DONE:
  29.     MOV AL, DL   ;save result to AL
  30.     MOV AH, 4CH  ;Select exit function
  31.     INT  21H     ;Call the interrupt to exit
  32.  
  33. END START
Advertisement
Add Comment
Please, Sign In to add comment