madhawaseeeee

Untitled

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