madhawaseeeee

final

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