Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STACK SEGMENT STACK
- DB 328 DUP(?)
- STACK ENDS
- DATA SEGMENT
- C DB ?
- DATA ENDS
- CODE SEGMENT
- ASSUME CS:CODE,DS:DATA,SS:STACK
- ;ax = S(dx,bx)
- S PROC
- cmp bx, dx
- jne CMP0
- mov AX, 1
- ret
- CMP0: cmp bx,0
- jne CALC
- mov ax, 0
- ret
- CALC: dec dx
- dec bx
- call S
- mov cx,ax
- push bx
- inc bx
- call S
- push cx
- mul bx
- pop cx
- pop bx
- add ax, cx
- ret
- S ENDP
- START: MOV AX,DATA
- MOV DS,AX
- MOV dx, 5
- mov bx, 2
- xor ax,ax
- CALL S
- mov bx,ax
- mov ax, 01h
- int 21h
- MOV AX,4C00H
- INT 21H
- CODE ENDS
- END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement