madhawaseeeee

final3

Sep 23rd, 2016
147
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.     ADD AL, BL    ;add AL and BL : A+B
  13.     MOV DL, AL    ;move result to DL
  14.     MOV AL, 5     ;reset AL(A) back to 5
  15.     SUB AL, BL    ;substract BL from AL and save result to AL : A-B
  16.     OR  AL, DL    ;or AL with DL and save result to AL  :A+B or A-B
  17.     MOV DL, AL    ;save result to DL
  18.     MOV AL, 5     ;reset AL back to 5
  19.  
  20. FINDY:
  21.     ADD AL, BL    ;ADD AL and BL :A+B
  22.     MUL CL        ;multiply AL by CL : (A+B)*C
  23.  
  24. OPTABLE:
  25.     XOR DL, AL    ;xor DL with AL :X XOR Y
  26.     SHL DL,1      ;shift result by 1 bit
  27.  
  28. DONE:
  29.     MOV AL, DL
  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