What is PSW in microprocessor 8085?
The current state of the processor is stored in a register called Processor Status Word(PSW).The PSW contains bits which indicate such things as whether the previous arithmetic operations produced a positive,negative or zero result. If a subtract instruction is followed by a “branch on zero” instruction ,then the branch will be taken if the PSW indicates that the subtraction resulted in a zero. Most loops,such as DO-WHILE,FOR,etc involve incrementing or decrementing a counter and repeating the loop until the counter reaches the limit.Each time the counter is changed,the result is compared with the limit,the PSW is set accordingly,and branch is taken or not depending on the contents of the PSW. The 8086 microprocessor has a 16-bit PSW.Each bit of this PSW is known as a flag and 7 out of these are not used.The 9 flags are classified into control flags and condition flags.