madhawaseeeee

final1

Sep 23rd, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL  SMALL     ; use 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 A-C
  13.     SUB AL, CL  ;subtract CL(C) from AL(A).
  14.     MOV DL, AL  ;save result to DL
  15.     MOV AL, 5   ;reset AL back to 5(A)
  16.  
  17. FINDY:
  18.     ;evaluate (A/B)-C
  19.     DIV BL        ;divide Al by BL : (A/B)
  20.     SUB AL, CL    ;subtract CL from AL :(A/B)-C
  21.  
  22. OPTABLE:
  23.     XOR DL,AL     ; XOR DL with AL and save it to DL
  24.     SHL DL, 1     ; shift result by 1 bit
  25.  
  26. DONE:
  27.     MOV AL, DL
  28.     MOV AH, 4CH   ;Select exit function
  29.     INT  21H      ;Call the interrupt to exit
  30.  
  31. END START
Advertisement
Add Comment
Please, Sign In to add comment