Keil™, An ARM® Company

Technical Support

A166: RET IS REPLACED WITH RETI OR RETS

Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.01

SYMPTOMS

I have written a procedure in assembler and I used a RET instruction to return from it. When I assemble my code, the RET instruction is replaced with RETI or RETS. What is going on?

CAUSE

You are using the PROC and ENDP statements to define your procedure. For that reason, when your file is assembled, the RET instruction is automatically converted to an appropriate machine return instruction. The appropriate return instruction is determined by the type of procedure (near, far or interrupt).

  • RETS Returns from far procedures.
  • RETI Returns from interrupt procedures.
  • RET Returns from near procedures.

MORE INFORMATION

  • Refer to PROC in the A166 User's Guide.
  • Refer to ENDP in the A166 User's Guide.

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure