registers of 8085 microprocessor - sncvarkalalms.org

4
6/23/2021 Registers of 8085 Microprocessor https://www.tutorialspoint.com/registers-of-8085-microprocessor 1/4 Registers of 8085 Microprocessor Registers of 8085 Microprocessor It has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC and It has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC and SP. These registers can be classified as − SP. These registers can be classified as − General Purpose Registers General Purpose Registers Temporary Registers: a) Temporary data register b) W and Z registers Temporary Registers: a) Temporary data register b) W and Z registers Special Purpose Registers: a)Accumulator b) Flag registers c) Instruction register Special Purpose Registers: a)Accumulator b) Flag registers c) Instruction register Sixteen-bit Registers: a) ProgramCounter (PC) b) Stack Pointer (SP) Sixteen-bit Registers: a) ProgramCounter (PC) b) Stack Pointer (SP) General Purpose Registers General Purpose Registers Registers B, C, D, E, H, and L are general purpose registers in 8085 Microprocessor. All these Registers B, C, D, E, H, and L are general purpose registers in 8085 Microprocessor. All these GPRS are 8-bits wide. They are less important than the accumulator. They are used to store GPRS are 8-bits wide. They are less important than the accumulator. They are used to store data temporarily during the execution of the program. For example, there is no instruction to add data temporarily during the execution of the program. For example, there is no instruction to add the contents of Band E registers. At least one of the operands has to be in A. Thus to add Band the contents of Band E registers. At least one of the operands has to be in A. Thus to add Band E registers, and to store the result in B register, the following have to be done. E registers, and to store the result in B register, the following have to be done. Move to A register the contents of B register. Move to A register the contents of B register. Then add A and E registers. The result will be in A. Then add A and E registers. The result will be in A. Move this result from A register to B register. Move this result from A register to B register. It is possible to use these registers as pairs to store 16-bit information. Only BC, DE, and HLcan It is possible to use these registers as pairs to store 16-bit information. Only BC, DE, and HLcan form register pairs. When they are used as register pairs in an instruction, the left register is form register pairs. When they are used as register pairs in an instruction, the left register is understood to have the MS byte and the right register the LS byte. For example, in DE register understood to have the MS byte and the right register the LS byte. For example, in DE register pair, the content of the D register is treated as the MS byte, and the content of E register is pair, the content of the D register is treated as the MS byte, and the content of E register is treated as the LS byte. treated as the LS byte. Temporary Registers Temporary Registers (a)Temporary Data Register (a)Temporary Data Register - The ALU has two inputs. One input is supplied by the The ALU has two inputs. One input is supplied by the accumulator and other from the temporary data register. The programmer cannot access this accumulator and other from the temporary data register. The programmer cannot access this temporary data register. However, it is internally used for execution of most of the arithmetic temporary data register. However, it is internally used for execution of most of the arithmetic and logical instructions. and logical instructions. (b) (b) W and Z registers W and Z registers - Wand Z registers are temporary registers. These registers are used to - Wand Z registers are temporary registers. These registers are used to hold 8-bit data during the execution of some instructions. These registers are not available for hold 8-bit data during the execution of some instructions. These registers are not available for the programmer since 8085Microprocessor Architecture uses them internally. the programmer since 8085Microprocessor Architecture uses them internally. Special Purpose Registers Special Purpose Registers (a) Register A(Accumulator) (a) Register A(Accumulator) - Register A is an 8-bit register used in 8085 to perform arithmetic, Register A is an 8-bit register used in 8085 to perform arithmetic, logical, I/O & LOAD/STORE operations. Register A is quite often called as an Accumulator. An logical, I/O & LOAD/STORE operations. Register A is quite often called as an Accumulator. An accumulator is a register for short-term, intermediate storage of arithmetic and logic data in a accumulator is a register for short-term, intermediate storage of arithmetic and logic data in a computer's CPU (Central Processing Unit).In an arithmetic operation involving two operands, one computer's CPU (Central Processing Unit).In an arithmetic operation involving two operands, one operand has to be in this register. And the result of the arithmetic operation will be stored or operand has to be in this register. And the result of the arithmetic operation will be stored or

Upload: others

Post on 05-Dec-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

6/23/2021 Registers of 8085 Microprocessor

https://www.tutorialspoint.com/registers-of-8085-microprocessor 1/4

Registers of 8085 MicroprocessorRegisters of 8085 Microprocessor

It has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC andIt has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC andSP. These registers can be classified as −SP. These registers can be classified as −

General Purpose RegistersGeneral Purpose Registers

Temporary Registers: a) Temporary data register b) W and Z registersTemporary Registers: a) Temporary data register b) W and Z registers

Special Purpose Registers: a)Accumulator b) Flag registers c) Instruction registerSpecial Purpose Registers: a)Accumulator b) Flag registers c) Instruction register

Sixteen-bit Registers: a) ProgramCounter (PC) b) Stack Pointer (SP)Sixteen-bit Registers: a) ProgramCounter (PC) b) Stack Pointer (SP)

General Purpose RegistersGeneral Purpose RegistersRegisters B, C, D, E, H, and L are general purpose registers in 8085 Microprocessor. All theseRegisters B, C, D, E, H, and L are general purpose registers in 8085 Microprocessor. All theseGPRS are 8-bits wide. They are less important than the accumulator. They are used to storeGPRS are 8-bits wide. They are less important than the accumulator. They are used to storedata temporarily during the execution of the program. For example, there is no instruction to adddata temporarily during the execution of the program. For example, there is no instruction to addthe contents of Band E registers. At least one of the operands has to be in A. Thus to add Bandthe contents of Band E registers. At least one of the operands has to be in A. Thus to add BandE registers, and to store the result in B register, the following have to be done.E registers, and to store the result in B register, the following have to be done.

Move to A register the contents of B register.Move to A register the contents of B register.

Then add A and E registers. The result will be in A.Then add A and E registers. The result will be in A.

Move this result from A register to B register.Move this result from A register to B register.

It is possible to use these registers as pairs to store 16-bit information. Only BC, DE, and HLcanIt is possible to use these registers as pairs to store 16-bit information. Only BC, DE, and HLcanform register pairs. When they are used as register pairs in an instruction, the left register isform register pairs. When they are used as register pairs in an instruction, the left register isunderstood to have the MS byte and the right register the LS byte. For example, in DE registerunderstood to have the MS byte and the right register the LS byte. For example, in DE registerpair, the content of the D register is treated as the MS byte, and the content of E register ispair, the content of the D register is treated as the MS byte, and the content of E register istreated as the LS byte.treated as the LS byte.

Temporary RegistersTemporary Registers(a)Temporary Data Register (a)Temporary Data Register -- The ALU has two inputs. One input is supplied by theThe ALU has two inputs. One input is supplied by theaccumulator and other from the temporary data register. The programmer cannot access thisaccumulator and other from the temporary data register. The programmer cannot access thistemporary data register. However, it is internally used for execution of most of the arithmetictemporary data register. However, it is internally used for execution of most of the arithmeticand logical instructions.and logical instructions.

(b)(b) W and Z registers W and Z registers - Wand Z registers are temporary registers. These registers are used to- Wand Z registers are temporary registers. These registers are used tohold 8-bit data during the execution of some instructions. These registers are not available forhold 8-bit data during the execution of some instructions. These registers are not available forthe programmer since 8085Microprocessor Architecture uses them internally.the programmer since 8085Microprocessor Architecture uses them internally.

Special Purpose RegistersSpecial Purpose Registers(a) Register A(Accumulator) (a) Register A(Accumulator) -- Register A is an 8-bit register used in 8085 to perform arithmetic,Register A is an 8-bit register used in 8085 to perform arithmetic,logical, I/O & LOAD/STORE operations. Register A is quite often called as an Accumulator. Anlogical, I/O & LOAD/STORE operations. Register A is quite often called as an Accumulator. Anaccumulator is a register for short-term, intermediate storage of arithmetic and logic data in aaccumulator is a register for short-term, intermediate storage of arithmetic and logic data in acomputer's CPU (Central Processing Unit).In an arithmetic operation involving two operands, onecomputer's CPU (Central Processing Unit).In an arithmetic operation involving two operands, oneoperand has to be in this register. And the result of the arithmetic operation will be stored oroperand has to be in this register. And the result of the arithmetic operation will be stored or

6/23/2021 Registers of 8085 Microprocessor

https://www.tutorialspoint.com/registers-of-8085-microprocessor 2/4

accumulated in this register. Similarly, in a logical operation involving two operands, one operandaccumulated in this register. Similarly, in a logical operation involving two operands, one operandhas to be in the accumulator. Also, some other operations, like complementing and decimalhas to be in the accumulator. Also, some other operations, like complementing and decimaladjustment, can be performed only on the accumulator.adjustment, can be performed only on the accumulator.

(b)Flag Register (b)Flag Register -- It is a 3-bit register, in which five of the bits carry significant information in theIt is a 3-bit register, in which five of the bits carry significant information in theform of flags: S (Sign flag), Z (Zero flag), AC(Auxiliary carry flag), P (Parity flag), and CY (carryform of flags: S (Sign flag), Z (Zero flag), AC(Auxiliary carry flag), P (Parity flag), and CY (carryflag); as shown in Fig. 1.2.flag); as shown in Fig. 1.2.

S-Sign flag S-Sign flag - After the execution of arithmetic or logical operations, if bit D7 of the result- After the execution of arithmetic or logical operations, if bit D7 of the resultis 1, the sign flag is set. In a given byte if D7 is1, the number will be viewed as ais 1, the sign flag is set. In a given byte if D7 is1, the number will be viewed as anegative number. If D7 is U, the number will be considered as a positive number.negative number. If D7 is U, the number will be considered as a positive number.

Z-Zero flagZ-Zero flag -The zero flag sets if the result of the operation in ALU is zero and flag -The zero flag sets if the result of the operation in ALU is zero and flagresets if the result is non zero. The zero flags are also set if a certain register contentresets if the result is non zero. The zero flags are also set if a certain register contentbecomes zero following an increment or decrement operation of that register.becomes zero following an increment or decrement operation of that register.

AC-auxiliary Carry flag AC-auxiliary Carry flag - This flag is set if there is an overflow out of bit 3 i.e. carry from- This flag is set if there is an overflow out of bit 3 i.e. carry fromlower nibble to higher nibble (D3 bit to D4 bit). This flag is used for BCD operations andlower nibble to higher nibble (D3 bit to D4 bit). This flag is used for BCD operations andit is not available for the programmer.it is not available for the programmer.

P-Parity flag P-Parity flag -- Parity is defined by the number of ones present in the accumulator. AfterParity is defined by the number of ones present in the accumulator. Afterarithmetic or logical operation, if the result has an even number of ones, i.e.even parity,arithmetic or logical operation, if the result has an even number of ones, i.e.even parity,the flag is set. If the parity is odd, the flag is reset.the flag is set. If the parity is odd, the flag is reset.

CY-Carry flag CY-Carry flag - This flag is set if there is an overflow out of bit 7. The carry flag also- This flag is set if there is an overflow out of bit 7. The carry flag alsoserves as a borrow flag for subtraction. In both the examples shown below, the carry flagserves as a borrow flag for subtraction. In both the examples shown below, the carry flagis set.is set.

Addition Addition

9BH -----> 1001 1011 9BH -----> 1001 1011

+75 H -----> + 0111 0101 +75 H -----> + 0111 0101

--------- ----------- --------- -----------

Carry 1 10 H -----> 1 0001 0000 Carry 1 10 H -----> 1 0001 0000

Subtraction Subtraction

89H -----> 1000 1001 89H -----> 1000 1001

6/23/2021 Registers of 8085 Microprocessor

https://www.tutorialspoint.com/registers-of-8085-microprocessor 3/4

-AB H -----> - 1010 1011 -AB H -----> - 1010 1011

--------- ----------- --------- -----------

Borrow1 10 H -----> 1 1101 1110 Borrow1 10 H -----> 1 1101 1110

c) Instruction Register c) Instruction Register - In a typical processor operation, the processor first fetches the- In a typical processor operation, the processor first fetches theopcodeof instruction from memory (i.e. it places an address on the address bus and memoryopcodeof instruction from memory (i.e. it places an address on the address bus and memoryresponds by placing the data stored at the specifiedaddress on the data bus). The CPUresponds by placing the data stored at the specifiedaddress on the data bus). The CPUstoresthis opcode in a register called the instruction register. Thisopcode is further sent to thestoresthis opcode in a register called the instruction register. Thisopcode is further sent to theinstruction decoder to select one ofthe 256 alternatives.instruction decoder to select one ofthe 256 alternatives.

4.SixteenBit Registers4.SixteenBit Registersa) Program counter (PC) a) Program counter (PC) - Program is a sequence of instructions. As mentioned earlier,- Program is a sequence of instructions. As mentioned earlier,microprocessor fetches these instructions from the memory and executes them The programmicroprocessor fetches these instructions from the memory and executes them The programcounter is a special purpose register which, at a given time,stores the address of the nextcounter is a special purpose register which, at a given time,stores the address of the nextinstruction to be fetched. Program Counter acts as a pointer to the next instruction. Howinstruction to be fetched. Program Counter acts as a pointer to the next instruction. Howprocessor increments program counter depends on the nature of the instruction;for one-byteprocessor increments program counter depends on the nature of the instruction;for one-byteinstruction it increments program counter by one, for two-byte instruction it increments programinstruction it increments program counter by one, for two-byte instruction it increments programcounter by two and forthree-byte instruction it increments program counter by three such thatcounter by two and forthree-byte instruction it increments program counter by three such thatprogram counter always points to the address of the next instruction.program counter always points to the address of the next instruction.

In case of JUMP and CALL instructions, address followed by JUMP and CALL instructions isIn case of JUMP and CALL instructions, address followed by JUMP and CALL instructions isplaced in the program counter. The processor then fetches the next instruction from the newplaced in the program counter. The processor then fetches the next instruction from the newaddress specified by JUMP or CALL instruction. In conditional JUMP and conditional CALLaddress specified by JUMP or CALL instruction. In conditional JUMP and conditional CALLinstructions, if the condition is not satisfied, the processor increments program counter by threeinstructions, if the condition is not satisfied, the processor increments program counter by threeso that it points the instruction followed by conditional JUMP or CALL instruction; otherwiseso that it points the instruction followed by conditional JUMP or CALL instruction; otherwiseprocessor fetches the next instruction from the new address specified by JUMP or CALLprocessor fetches the next instruction from the new address specified by JUMP or CALLinstruction.instruction.

b)Stack Pointer (SP) b)Stack Pointer (SP) - The stack is a reserved area of the memory in the RAM where temporary- The stack is a reserved area of the memory in the RAM where temporaryinformation may be stored. A 16-bit stack pointer is used to hold the address of the most recentinformation may be stored. A 16-bit stack pointer is used to hold the address of the most recentstack entry.stack entry.

In the following figure depicts the architecture of 8085 microprocessor and with its registerIn the following figure depicts the architecture of 8085 microprocessor and with its registerorganization – organization –

6/23/2021 Registers of 8085 Microprocessor

https://www.tutorialspoint.com/registers-of-8085-microprocessor 4/4