Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Program status word(PSW) or Flag register

Program status word(PSW) or Flag register


Carry Flag
Auxillary carry Flag
Overflow flag

Overflow flag is set when there is a carry after adding D6th bit but
no carry after adding D7th bit.
Or Overflow flag is set when there is no carry after adding D6th bit
but carry after adding D7th bit.
Overflow flag
• Overflag is checked only for signed numbers.
• Unsigned 8 bit data ranges from 00H to FFH
• Signed 8 bit data
• Positive number ranges from 00H to 7FH
• Negative number ranges from 80H to FFH
• 7F(H)(0111 1111)BMSB is zero positive
number
• 80(H)(1000 0000)B MSB is one negative
number
Parity flag
• When Accumulator has odd number of ones
parity flag will set.

• Eg. A (0010 1010)B; P1


• A (0011 1010)B; P0
Program status word(PSW) or Flag register
RAM Organization
RAM Organization
Register Banks
Register Banks
Register Banks
Program
• Org 0000h
• SETB PSW.3
• SETB PSW.4;SWITCHING TO BANK 3
• MOV R0,#4FH
• MOV A,#32H
• ADD A, R0
• CLR PSW.3;SWITCHING TO BANK 2
• MOV R0,#67H
• ADD A,R0
• CLR PSW.4
• MOV R7,#78H

You might also like