Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STACK SEGMENT STACK
  2. DB 328 DUP(?)
  3. STACK ENDS
  4. DATA SEGMENT
  5. C DB ?
  6. DATA ENDS
  7. CODE SEGMENT
  8. ASSUME CS:CODE,DS:DATA,SS:STACK
  9.  
  10. ;ax = S(dx,bx)
  11. S PROC
  12. cmp bx, dx
  13. jne CMP0
  14. mov AX, 1
  15. ret
  16. CMP0: cmp bx,0
  17. jne CALC
  18. mov ax, 0
  19. ret
  20. CALC: dec dx
  21. dec bx
  22. call S
  23. mov cx,ax
  24. push bx
  25. inc bx
  26. call S
  27. push cx
  28. mul bx
  29. pop cx
  30. pop bx
  31. add ax, cx
  32. ret
  33. S ENDP
  34. START: MOV AX,DATA
  35. MOV DS,AX
  36. MOV dx, 5
  37. mov bx, 2
  38. xor ax,ax
  39. CALL S
  40. mov bx,ax
  41. mov ax, 01h
  42. int 21h
  43.  
  44. MOV AX,4C00H
  45. INT 21H
  46.  
  47. CODE ENDS
  48. END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement