Found 558 Articles for Microprocessor

8085 program to find square of a 8 bit number

Chandu yadav
Updated on 30-Jul-2019 22:30:25

3K+ Views

In this program, we will see how to find the square of an 8-bit number.Problem StatementWrite 8085 Assembly language program to find the square of a number The number is stored at location 8000H, store the result at 8050H.DiscussionIn 8085, we cannot perform the multiplication operation directly. We are performing the multiplication by using repetitive addition. To get square of a number, we have to multiply the number with itself.InputAddressData……80000C……Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, 80 LXI H, 8000HLoad the number from 8000HF003AF XRA AClear accumulatorF00446 MOV B, MLoad data from memory to BF00586LOOPADD MAdd memory byte with AF00605 DCR BDecrease B by 1F007C2, 05, F0 JNZ ... Read More

8085 program to find nth power of a number

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

622 Views

In this program we will see how to find nth power of a number.Problem StatementWrite 8085 Assembly language program to find nth power of a number. The base is stored at location 8000H, and the exponent is stored at 8001H. Store the result at 8002H.DiscussionIn 8085, we cannot perform the multiplication operation directly. Here we are writing a subroutine to perform the multiplication by using repetitive addition. To perform nth power of a number, we have to multiply the number n times. The n value is used as a counter. If the base is 03H, exponent is 05H, then the ... Read More

8085 program to count the number of ones in contents of register B

Ankith Reddy
Updated on 30-Jul-2019 22:30:25

2K+ Views

In this program, we will see how to count the number of 1’s in an 8-bit number stored in register B.Problem StatementWrite 8085 Assembly language program to count the number of 1s in 8-bit number stored in register B.DiscussionIn this program, we are using the rotate operation to count the number of 1’s. As there are 8 different bits in 8-bit number, then we are rotating the number eight times. we can use RRC or RLC. Here we have used the RRC instruction. This instruction sends the LSb to MSb also to carry flag. So after each iteration, we can ... Read More

8085 program to find the factorial of a number

George John
Updated on 30-Jul-2019 22:30:25

8K+ Views

In this program we will see how to find the factorial of a number.Problem StatementWrite 8085 Assembly language program to find the factorial of an 8-bit number.DiscussionIn 8085, there is no direct instruction to perform multiplication. We need to perform repetitive addition to get the result of the multiplication. In each step we are decreasing the value of B and multiply with the previous value of B. We are repeating these steps until B reaches 1. and B – 1 to 0. Thus the factorial is generated.InputAddressData800005Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, 80 LXI H, 8000HLoad the numberF00346 MOV B, MTake number from memory ... Read More

8085 program to multiply two 8 bit numbers using logical instructions

Chandu yadav
Updated on 30-Jul-2019 22:30:25

1K+ Views

In this program we will see how to multiply using logical operators.Problem StatementWrite 8085 Assembly language program to multiply two 8-bit numbers using logical operators.DiscussionWe are assuming the first number is in register B, and second number is in register C, and the result must not have any carry.Here we are multiplying with 04H. We can perform the multiplication by left rotate two times. Assign 06H into B, and 04H into C. Load B to A, then rotate the accumulator two times. Store the result into a specified memory.InputRegisterDataB06C04Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00006, 06 MVI B, 06H F0020E, 04 MVI C, 04H F00478 MOV A, BLoad B ... Read More

8085 program to add three 16 bit numbers stored in registers

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

2K+ Views

In this program we will see how to add three 16-bit numbers stored in register pairs.Problem StatementWrite 8085 Assembly language program to add three 16-bit numbers stored in register pair BC, DE and HL. Store the result at DE register pair.DiscussionIn this program we are storing the 16-bit numbers into BC, DE and HL pair. We have DAD D instruction which helps to add HL and DE register pair, and store the result into HL pair. After that copy BC to DE, then again perform DAD D to add them. Finally using XCHG we are storing them into DE register ... Read More

Instruction cycle in 8085 Microprocessor

Chandu yadav
Updated on 30-Jul-2019 22:30:25

4K+ Views

The Program and data which are stored in the memory, are used externally to the microprocessor for executing the complete instruction cycle. Thus to execute a complete instruction of the program, the following steps should be performed by the 8085 microprocessor.Fetching the opcode from the memory;Decoding the opcode to identify the specific set of instructions;Fetching the remaining Bytes left for the instruction, if the instruction length is of 2 Bytes or 3 Bytes;Executing the complete instruction procedure.The given steps altogether constitute the complete instruction cycle. These above mentioned steps are described in detail later. The above instructions are assumed by ... Read More

Internal address latch in 8085 Microprocessor

George John
Updated on 30-Jul-2019 22:30:25

362 Views

The select unit of the register in the 8085 selects any one of the register pairs (BC, DE, HL, SP, PC, or WZ) for sending them to it to the latch unit specified for addressing. For example, the contents of the PC be C200H. If the selection unit be the register which selects the PC, and sends C200H from the PC to the address latch internally thereafter the latch holds the specified value and sends directly out to the pins of the address after buffering. The Most Significant Byte of the address i.e. the C2H, is sent out to the ... Read More

Address/data buffers in 8085 Microprocessor

Chandu yadav
Updated on 30-Jul-2019 22:30:25

2K+ Views

Address and data buffers are used for bidirectional data transfer. They perform the unidirectional data transfer when they send out the Least Significant Byte of the address. These buffers are only used for increasing the driving capacity of the current. Through the internal bus data goes to the buffers. The Least Significant Byte of the address goes to the buffers from the internal address latch to the other.Hence the address or data are sent out on the address ranging from AD7 to AD0 can drive every external chips, like chips of RAM, chips of EPROM, and other peripheral chips meant for ... Read More

Multiplexer/demultiplexer in 8085 Microprocessor

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

5K+ Views

Let us consider the instruction to be executed as “MOV A, C”. Here in this case the value of 8 bit in the register C must be moved to the register. The given set of registers namely B, C, D, E, H, and L must be connected to the internal bus by means of a multiplexer (many input but only one output) or demultiplexer the reverse of multiplexer. The register meant to carry the work selects the specific unit and sends the appropriate code to the multiplexer such that the contents of register C are sent out to the multiplexer ... Read More

Advertisements