answersLogoWhite

0

LXI SP, 27FFH ; Initialize stack pointer

LDA 2200H ; Get the number

CPI 02H ; Check if number is greater than 1

JC LAST

MVI D, 00H ; Load number as a result

MOV E, A

DCR A

MOV C,A ; Load counter one less than number

CALL FACTO ; Call subroutine FACTO

XCHG ; Get the result in HL

SHLD 2201H ; Store result in the memory

JMP END

LAST: LXI H, 000lH ; Store result = 01

END: SHLD 2201H

HLT

Subroutine Program:

FACTO:LXI H, 0000H

MOV B, C ; Load counter

BACK: DAD D

DCR B

JNZ BACK ; Multiply by successive addition

XCHG ; Store result in DE

DCR C ; Decrement counter

CNZ FACTO ; Call subroutine FACTO

RET ; Return to main program

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

How many data lines in 8051?

The 8051 microcontroller has four data lines, which are used for the 8-bit data bus. This allows it to transmit data in 8-bit chunks, supporting operations with 8-bit data types. The architecture enables it to interface with various peripherals and memory components effectively.


What is the meaning of auxillary in 8051?

it is developed in year 1980 and official designation family is MCS 51.. so it is comprimise of two words 80 and 51


List different address modes of 8051micro controller with example?

The 8051 microcontroller employs several addressing modes, including: Immediate Addressing Mode: The operand is specified in the instruction itself. Example: MOV A, #25H moves the hexadecimal value 25 into the accumulator. Register Addressing Mode: The operand is in a register. Example: MOV A, R0 moves the content of register R0 into the accumulator. Direct Addressing Mode: The operand's address is given directly in the instruction. Example: MOV A, 30H moves the content of memory location 30H into the accumulator. Indirect Addressing Mode: The address of the operand is held in a register. Example: MOV A, @R1 moves the content of the memory location pointed to by register R1 into the accumulator.


What is the function of dptr?

The dptr (data pointer) is a register used in microcontroller architectures, particularly in the 8051 family, to point to data in memory. It facilitates access to data stored in external RAM or in the data memory space, allowing for efficient data manipulation and retrieval. By using dptr, programs can handle larger data sets and perform operations on data located beyond the internal memory limits.


Assembly language programme 8051 convert degree to Fahrenheit?

## temp.a ask user for temperature in Celsius, ## convert to Fahrenheit, print the result. ## ## v0 - reads in celsius ## t0 - holds Fahrenheit result ## a0 - points to output strings ## ################################################# # # # text segment # # # ################################################# .text .globl __start __start: la $a0,prompt # print prompt on terminal li $v0,4 syscall li $v0,5 # syscall 5 reads an integer syscall mul $t0,$v0,9 # to convert,multiply by 9, div $t0,$t0,5 # divide by 5,then add $t0,$t0,32 # add 32 la $a0,ans1 # print string before result li $v0,4 syscall move $a0,$t0 # print result li $v0,1 syscall la $a0,endl # system call to print li $v0,4 # out a newline syscall li $v0,10 syscall # au revoir... ################################################# # # # data segment # # # ################################################# .data prompt: .asciiz "Enter temperature (Celsius): " ans1: .asciiz "The temperature in Fahrenheit is " endl: .asciiz "\n" ## ## end of file temp.a

Related Questions

How temperature is measured using 8051 micro-controller?

how temperature is measured using 8051 micro-controler?


What are 8051 based systems?

The 8051 is a micro-controller series, basically a computer on a chip. A system based on the 8051 series micro-controller is simply that, a device or series of devices that operate under control of one or more 8051 micro-controllers.


How do you write the 8051 micro controller alp for finding the largest number in an array?

1


Difference between avr micro controller and 8051 micro controller?

constructed on a single chip is called micro processor constructed on a single board is called micro controller


Why 8051 is called 8 bit micro controller?

A: Because it can only control 8 bits of data.


What is purpose of ram in 8051 micro controller?

the internal RAM is for data storage and for many applications is all that is needed.


What are the advantages of PIC micro controller over 8051?

In general, personal preference and experience is what it comes down to. There are some PIC's that have built in RF systems; I don't believe there are any 8051's with this capability.


What are the advantages of PIC micro-controller over 8051?

In general, personal preference and experience is what it comes down to. There are some PIC's that have built in RF systems; I don't believe there are any 8051's with this capability.


How many ports in 8051 micro controller?

They are mainly four ports in 8051MC. port 0 port 1 port 2 port 3


Why you use 12mhz in 8051 micro controller?

Like many early microprocessors it has a 1mhz internal clock for its' operation. 12mhz is divided internally by 12 to derive this frequency.


What are the control signals for 8051 micro controller?

EA - External Access PSEN - Program store Enable ALE - Address Latch Enable RST - Reset WR - RD


Why the frequency is 11.059 Hz in 8051 micro-controller?

First let me make you correct it's not 11.059 Hz it's 11.0592 MHz and we select? this crystal because it makes 8051 Microcontroller to be compatible with IBM standard PC(baud rate 9600) to transfer data.