madhawaseeeee

Untitled

Sep 21st, 2016
150
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:  ;set nic 1st(A) ,2nd(B) ,3rd(C) numbers to AL,BL,CL registers
  6.     MOV AL, 5
  7.     MOV BL, 5
  8.     MOV CL, 0
  9. FINDX:    
  10.     ADD BL, AL ;ADD 1st and 2nd number / result is in the BL
  11.     MOV DL,BL  ;save result in DL  
  12. RESETXY:
  13.     MOV BL, 5  ;BL has changed.reset it's value back to 5
  14. FINDY:
  15.     MUL BL     ;multiply AL(1st number) with BL(2nd number); y=A*B
  16. OPTABLE:
  17.     XOR DL, AL ;XOR DL with AL and save it to DL
  18.     SHL DL,1   ;shift result by 1 bit
  19. DONE:
  20.     MOV AL, DL  ;move final result to AL
  21.     MOV AH, 4CH ;Select exit function
  22.     INT  21H        ;Call the interrupt to exit
  23.  
  24. END START
Advertisement
Add Comment
Please, Sign In to add comment