CY, The Carry Flag: PSW (Program Status Word) Register
CY, The Carry Flag: PSW (Program Status Word) Register
It is
also referred to as the flag register. Although the PSW register is 8 bits wide, only 6 bits of it are used
by the 8051. The two unused bits are user-definable flags. Four of the flags are called conditional flags,
meaning that they indicate some conditions that result after an instruction is executed. These four are
CY (carry), AC (auxiliary carry), P (parity), and OV (overflow).
When a "CALL" instruction is used, the current program counter (PC) value is
automatically pushed onto the stack, allowing the program to return to the next
instruction after the subroutine is completed. A "JUMP" instruction does not save
the return address, so there is no way to come back to the previous execution
point.
5.State the difference between MOV and MOVX
Instructions
MOV copies the value of source into destination. The value of source is not affected. Both destination
and source must be in Internal RAM. No flags are affected unless the instruction is moving the value of a
bit into the carry bit in which case the carry bit is affected or unless the instruction is moving a value into
the PSW register (which contains all the program flags).
MOVX moves a byte to or from External Memory into or from the Accumulator. If operand1 is @DPTR,
the Accumulator is moved to the 16-bit External Memory address indicated by DPTR. This instruction
uses both P0 (port 0) and P2 (port 2) to output the 16-bit address and data. If operand2 is DPTR then the
byte is moved from External Memory into the Accumulator.