- Back to Home »
- Programming »
- Return Instruction, RC, RNC, RP, RM, RZ, RNZ,RPE, RPO, RET
The program sequence is transferred from the subroutine to the calling program based on the specified flag of the PSW as described below. The two bytes from the top of the stack are copied into the program counter, and program execution begins at the new address.
1. RC: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if C=1 (or carry is 1)
Eg: - RC ABC (jump to the level abc if C=1)
2. RNC: - (conditional call) The program sequence is transferred to a particular level or a 16-bit
address if C=0 (or carry is 0)
address if C=0 (or carry is 0)
Eg: - RNC ABC (jump to the level abc if C=0)
3. RP: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if S=0 (or sign is 0)
Eg: - RP ABC (jump to the level abc if S=0)
4. RM: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if S=1 (or sign is 1)
Eg: - RM ABC (jump to the level abc if S=1)
5. RZ: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if Z=1 (or zero flag is 1)
Eg: - RZ ABC (jump to the level abc if Z=1)
6. RNZ: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if Z=0 (or zero flag is 0)
Eg: - RNZ ABC (jump to the level abc if Z=0)
7. RPE: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if P=1 (or parity is 1)
Eg: - RPE ABC (jump to the level abc if P=1)
8. RPO: - (conditional call) The program sequence is transferred to a particular level or a 16-bit address if P=0 (or parity is 0)
Eg: - RPO ABC (jump to the level abc if P=0)
9.RET: - Return from subroutine unconditionally
i wan more about instructions
ReplyDelete