Download Print this page

ZiLOG Z80380 User Manual page 174

Advertisement

Z
ILOG
RET
RETURN
RET [cc]
Operation:
if (cc is TRUE) then begin
if (XM) then begin
PC(7-0)
PC(15-8)
PC(23-16)
PC(31-24)
SP
end
else begin
PC(7-0)
PC(15-8)
SP
end
end
This instruction is used to return to a previously executing procedure at the end of a
procedure entered by a Call instruction. For a conditional return, one of the Zero, Carry, Sign,
or Parity/Overflow flags is checked to see if its setting matches the condition code "cc"
encoded in the instruction; if the condition is not satisfied, the instruction following the Return
instruction is executed, otherwise a value is popped from the stack and loaded into the
Program Counter (PC), thereby specifying the location of the next instruction to be executed.
For an unconditional return, the return is always taken and a condition code is not specified.
This instruction is also used to return to a previously executing procedure at the end of a
procedure entered by an interrupt in the assigned vectors mode, if Z80 family peripherals
are used external to the Z380 MPU.
Flags:
S:
Unaffected
Z:
Unaffected
H:
Unaffected
V:
Unaffected
N:
Unaffected
C:
Unaffected
Addressing
Mode
Syntax
RET CC
RET
Field Encodings: cc: 000 for NZ, 001 for Z, 010 for NC, 011 for C,
100 for PO/NV, 101 for PE/V, 110 for P/NS, 111 for M/S
Note:
2 if CC is false, 2+r if CC is true
5-140
(SP)
(SP+1)
(SP+2)
(SP+3)
SP + 4
(SP)
(SP+1)
SP + 2
Instruction Format
11-cc000
11001001
Execute
Time
Note
note
X
2+r
X
Z380
U
'
M
SER
S
ANUAL
DC-8297-03

Advertisement

loading
Need help?

Need help?

Do you have a question about the Z80380 and is the answer not in the manual?

Questions and answers