Embedded

8051 Microcontroller Flags

By CourseTron Team ·  1 min read ·  Updated Oct 2026 💬 𝕏 in f
Table of Contents

    8051 PSW

    8051 Microcontroller Flags

    8051 flags are status bits in the PSW register that record arithmetic and logic results for use by branch, compare, and multi-byte operations.

    Quick answer

    8051 flags are status bits in the PSW register that record arithmetic and logic results for use by branch, compare, and multi-byte operations.

    Key points to remember

    • CY, AC, OV, and P are core status flags.
    • PSW also stores register bank select bits.
    • Flags are critical for branching and multi-byte arithmetic.

    Important flags

    The carry flag CY is used for addition, subtraction, rotates, and multi-byte arithmetic. Auxiliary carry AC helps BCD adjustment. Overflow OV indicates signed arithmetic overflow. Parity P reflects accumulator parity. User and register bank bits also live in PSW.

    How flags affect programs

    Flags let firmware make decisions after arithmetic or bit operations. For example, multi-byte addition uses carry propagation, compare routines use carry and zero-like conditions, and signed calculations need overflow awareness.

    FAQ

    Where are 8051 flags stored?

    They are stored in the Program Status Word, or PSW, register.

    Which flag is used in multi-byte addition?

    The carry flag is used to propagate carries between lower and higher bytes.

    Advertisement