Small Recursive program

Source: Internet
Author: User

To find the factorial of n, keyboard input n, the results are stored in AX.

1 DATA SEGMENT2 3 DATA ENDS4 STACK1 SEGMENT STACK5DB 50H DUP (0)6 STACK1 ENDS7 CODE SEGMENT8 assume Cs:code,ds:data,ss:stack19 Start:mov Ax,dataTen MOV Ds,ax OneMOV AH,1; INPUT (AL) A INT 21H - XOR Ah,ah - SUB al,30h theMOV DX,1 - Call Digui - MOV ah,4ch; RETURN DOS - INT 21H + Digui PROC near -CMP AL,0 + JE RET1 A PUSH AX at DEC AL - Call Digui - POP AX - MUL DL - MOV Dx,ax - Ret1:ret in Digui ENDP - CODE ENDS to END START +     
View Code

Small Recursive program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.