<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3AOpcodes%3ARET</id>
	<title>Z80:Opcodes:RET - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3AOpcodes%3ARET"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Opcodes:RET&amp;action=history"/>
	<updated>2026-05-28T05:44:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Opcodes:RET&amp;diff=326&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Opcodes:RET&amp;diff=326&amp;oldid=prev"/>
		<updated>2016-02-05T22:43:07Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Short summary of instruction --&amp;gt;&lt;br /&gt;
Pops the top of the stack into the program counter. Note that RET can be either conditional or unconditional.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Syntax for this instruction --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    ret		;no conditions&lt;br /&gt;
    ret cond.	;conditional&lt;br /&gt;
&lt;br /&gt;
=== Allowed Instructions ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- All possible inputs --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    ret z     ; Z flag is set&lt;br /&gt;
    ret nz      ; Z flag is reset&lt;br /&gt;
    ret c    ; Carry flag is set&lt;br /&gt;
    ret nc    ; Carry flag is reset&lt;br /&gt;
    ret m    ; S flag is set&lt;br /&gt;
    ret p    ; S flag is reset&lt;br /&gt;
    ret pe    ; P/V is set&lt;br /&gt;
    ret po    ; P/V is reset&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- What the instruction does to flags --&amp;gt;&lt;br /&gt;
Preserves all flags.&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- What the instruction can be used for --&amp;gt;&lt;br /&gt;
RET is used mostly for exiting an assembly program or returning from a routine.&lt;br /&gt;
&lt;br /&gt;
== T-States ==&lt;br /&gt;
cc is condition: NZ, Z, NC, C, PO, PE, P, M&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| ret || 10 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| || condition true || condition false &lt;br /&gt;
|-&lt;br /&gt;
| ret cc || 11 || 5 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Other instructions that are related to this one --&amp;gt;&lt;br /&gt;
[[Z80:Opcodes:BIT|BIT]],[[Z80:Opcodes:CALL|CALL]],[[Z80:Opcodes:CP|CP]],[[Z80:Opcodes:CPD|CPD]],[[Z80:Opcodes:CPDR|CPDR]],[[Z80:Opcodes:CPI|CPI]],[[Z80:Opcodes:CPIR|CPIR]],[[Z80:Opcodes:RETI|RETI]],[[Z80:Opcodes:RETN|RETN]]&lt;br /&gt;
&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
[[Category:Z80 Assembly]]&lt;br /&gt;
[[Category:Z80 Heaven]]&lt;br /&gt;
[[Category:Z80 Opcodes]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>