0% found this document useful (0 votes)
0 views

Lab no 04

The document outlines a program designed to calculate the factorial of a number using registers in an embedded system or microprocessor environment. It includes source code that demonstrates the implementation, specifically calculating the factorial of 3. The objective is to evaluate the program's efficiency in terms of computational steps and resource utilization.

Uploaded by

Zulqurnan Anjum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Lab no 04

The document outlines a program designed to calculate the factorial of a number using registers in an embedded system or microprocessor environment. It includes source code that demonstrates the implementation, specifically calculating the factorial of 3. The objective is to evaluate the program's efficiency in terms of computational steps and resource utilization.

Uploaded by

Zulqurnan Anjum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab no 04

Find Factorial in registers

Objective:
To implement a program that calculates the factorial of a number using registers and
evaluate its efficiency in terms of computational steps and resource utilization in an embedded
system or microprocessor environment.

Source code.

AREA Mycode, CODE, READONLY


ENTRY
EXPORT Reset_Handler
Reset_Handler
MOV R1, #3
MOV R0, #1
LOOP
CMP R1, #0
MUL R0, R0, R1
SUB R1, R1, #1
BNE LOOP
END

Fig 4.1

( Aleeza Imran) 2022-EE-30


Output:

(Here is the final output of factorial of 3)

( Aleeza Imran) 2022-EE-30

You might also like