Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to find the factorial of a number use subroutine

Posted By: Bogart Fischer     Category: Assembly Language     Views: 13746

Write a program to find the factorial of a number
use subroutine.

Code for Program to find the factorial of a number use subroutine in Assembly Language

DATA SEGMENT
    NO DW 5
DATA ENDS

CODE SEGMENT
         FACTO PROC NEAR
                  ASSUME CS:CODE
                  MOV AX,0000
                  POP BX
                  POP AX
                  PUSH BX
                  MOV BL,AL
                  DEC BL

               L1:MUL BL
                  DEC BL
                  CMP BL,00
                  JNE L1
      L2:RET
         FACTO ENDP
         ASSUME DS:DATA,CS:CODE
START:
          MOV AX,DATA
          MOV DS,AX
          PUSH NO
          CALL FACTO
          MOV BH,00
          MOV AH,4CH
          INT 21H
CODE ENDS
END START

;------
;OUTPUT
;------

        -G CS: 0020

        AX=0078  BX=0000  CX=0036  DX=0000  SP=0000  BP=0000  SI=0000  DI=0000
        DS=0BA4  ES=0B94  SS=0BA4  CS=0BA5  IP=0020   NV UP EI PL ZR NA PE NC
        0BA5:0020 B700          MOV     BH,00
        -Q
  
Share: 


Didn't find what you were looking for? Find more on Program to find the factorial of a number use subroutine Or get search suggestion and latest updates.

Bogart Fischer
Bogart Fischer author of Program to find the factorial of a number use subroutine is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!