From Learn @ Cemetech
Revision as of 18:43, 5 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Pops the top of the stack into the program counter. Note that RET can be either conditional or unconditional.


   ret		;no conditions
   ret cond.	;conditional

Allowed Instructions

   ret z     ; Z flag is set
   ret nz      ; Z flag is reset
   ret c    ; Carry flag is set
   ret nc    ; Carry flag is reset
   ret m    ; S flag is set
   ret p    ; S flag is reset
   ret pe    ; P/V is set
   ret po    ; P/V is reset


Preserves all flags.


RET is used mostly for exiting an assembly program or returning from a routine.


cc is condition: NZ, Z, NC, C, PO, PE, P, M

ret 10
condition true condition false
ret cc 11 5

See Also