Zilog Z16F2810 Uživatelský manuál Strana 162

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 216
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 161
RET Instruction UM018809-0611
146
ZNEO
®
CPU Core
User Manual
RET
Definition
Return
Syntax
RET
Operation
PC (SP)
SP SP
+ 4
Description
This instruction returns from a procedure entered by a CALL instruction. The contents of the
location addressed by the Stack Pointer are loaded into the Program Counter. The next statement
executed is the one addressed by the new contents of the Program Counter. The Stack Pointer
also increments by four.
Any Push or other instructions in the subroutine that decrements the stack pointer must
be followed by matching Pop or increment instructions to ensure the Stack Pointer is at
the correct location when RET is executed. Otherwise, the wrong address loads into the
Program Counter and the program cannot operate properly.
Flags
Flags are not affected by this instruction.
Syntax and Opcodes
Example
Before:
PC=0035_292EH, SP=FFFF_DB1EH, FFFF_DB1CH=0000_0454H
RET ;Object Code: FFFC
After:
PC=0000_0454H, SP=FFFF_DB22H
Instruction, Operands Word 0 Word 1 Word 2
RET FFFCH
Caution:
Zobrazit stránku 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 215 216

Komentáře k této Příručce

Žádné komentáře