0% found this document useful (0 votes)
302 views10 pages

PSW Register in 8051 Microcontroller - Program Status Word

Program status word

Uploaded by

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

PSW Register in 8051 Microcontroller - Program Status Word

Program status word

Uploaded by

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

Facebook®

Shop It. Sell It. Share VISIT SITE


It.

Easy Notes for You

Home

MCQs

Video Tutorials

Contact

PSW Register in 8051 Microcontroller | Program Status


Word
2 Comments / By EFY / 21/05/2023

Flags are single bit register and used to store the result of certain function after
executing instruction. Flags are grouped inside PSW and PCON registers.
PSW register in 8051 microcontroller contains math flags and PCON contains general
user flags.
Math flags are grouped in PSW of microcontroller 8051 and they are Carry(C), Auxiliary
Carry (AC), Over flow (OV), and Parity (P). The general user flags are GF0 and GF1 which
are grouped in PCON register.

PSW Register in 8051


The PSW is accessible fully as an 8-bit register, with the address D0H.
The bit pattern of this flag register is

Figure 1: Format of PSW register in 8051 Microcontroller


Parity bit (P)
This parity flag bit is used to show the number of 1s in the accumulator only. If the
accumulator register contains an odd number of 1s, then this flag set to 1.
If accumulator contains even number of 1s, then this flag cleared to 0.

Overflow flag (OV)


This flag is set during ALU operations, to indicate overflow in the result. It is set to 1 if
there is a carry out of either the D7 bit or the D6 bit of the accumulator.
Overflow flag is set when arithmetic operations such as add and subtract result in
sign conflict.

The conditions under which the OV flag is set are as follows:


Positive + Positive = Negative
Negative + Negative = Positive
Positive – Negative = Negative
Negative – Positive = Positive

Register bank select bits (RS1 and RS0)


These two bits are used to select one of four register banks of RAM. By setting and
clearing these bits, registers R0-R7 are stored in one of four banks of RAM as follows.

RS1 RS0 Bank Selected Address of Registers

0 0 Bank 0 00h-07h

0 1 Bank 1 08h-0Fh

1 0 Bank 2 10h-17h

1 1 Bank 3 18h-1Fh

These bits are user-programmable. They can be set by the programmer to point to the
correct register banks.
The register bank selection in the programs can be changed using these two bits.

General-purpose flag (F0)


This is a user-programmable flag; the user can program and store any bit of his/her
choice in this flag, using the bit address.

Auxiliary carry flag (AC)


It is used in association with BCD arithmetic. This flag is set when there is a carry out
of the D3 bit of the accumulator.

Carry flag (CY)


This flag is used to indicate the carry generated after arithmetic operations. It can
also be used as an accumulator, to store one of the data bits for bit-related Boolean
instructions.

The 8051 supports bit manipulation instructions.


This means that in addition to the byte operations, bit operations can also be done using
bit data.
For this purpose, the contents of the PSW are bit-addressable.
Figure 2: Instructions that affect the flags in 8051 microcontroller

Recent posts
Architecture of RTOS in Embedded Systems

Embedded System

Need, Requirement and Specifications of RTOS

Embedded System

Related Posts:

1. Assembler Directives in 8051 Microcontroller


2. Features of 8051 Microcontroller
3. Memory Organization of 8051 Microcontroller
4. Addressing Modes in 8051 Microcontroller
5. Instruction Set in 8051 Microcontroller
6. Architecture of 8051 Microcontroller
7. Pin Configuration of 8051 Microcontroller
8. The Stack and Stack Pointer in 8051 Microcontroller
9. Stack Pointer Data Pointer and Program Counter in 8051 Microcontroller
10. Functions of Timing and Control Unit of 8051
11. Functions of Ports in 8051 Microcontroller
12. Port Structure of 8051 Microcontroller
13. Reset Circuit of 8051 Microcontroller
14. Registers in 8051 Microcontroller
15. Boolean Processor in 8051 Microcontroller
16. Power Saving Mode in 8051 | 8051 Power Down and Idle Mode
17. 8051 Microcontroller Family
18. Program Development Steps in ALP
← Previous Post Next Post →

2 thoughts on “PSW Register in 8051 Microcontroller | Program


Status Word”

SBGNIKI325877782
21/05/2023 AT 10:06 PM

Great information. Lucky me I recently found your blog by accident (stumbleupon). I have book-
marked it for later!

AUGUSTUSRECH838
21/05/2023 AT 9:08 PM

I have read a few good stuff here. Definitely price bookmarking for revisiting. I wonder how much
attempt you put to make this type of wonderful informative web site.
Comments are closed.

Search... SEA

Related Posts:
1. Assembler Directives in 8051 Microcontroller

2. Features of 8051 Microcontroller

3. Memory Organization of 8051 Microcontroller

4. Addressing Modes in 8051 Microcontroller

5. Instruction Set in 8051 Microcontroller

6. Architecture of 8051 Microcontroller


Categories

Components (16)

Control Systems (6)

Embedded System (10)

Instrumentation (22)

MCQ (35)

Microcontroller 8051 (38)

Microprocessor-8085 (32)

Network Theory Lab (10)

Numerical Methods (5)

Operational Amplifiers (12)

Recruitments (1)

Seminar Topics (15)

Uncategorized (16)

VHDL (16)
Subscribe Categ About
ories
Contact
Enter Ema SUBSCRIBE
Instrum About

entation us

Operati Privacy

onal policy

Amplifie Disclai

rs mer

Control
System
s
MCQs

Copyright © 2024 Easy Notes for You | Powered by Easy Notes for You

You might also like