RETURN
Aus MCS Wiki AVR
(Unterschied zwischen Versionen)
(→See also) |
Admin (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Action</span> = |
− | + | Return from a subroutine. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
Zeile 15: | Zeile 15: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Remarks</span> = |
− | + | Subroutines must be ended with a related RETURN statement. | |
+ | |||
+ | Interrupt subroutines must also be terminated with the Return statement. | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
Zeile 23: | Zeile 25: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">See also</span> = |
− | [[ | + | [[GOSUB]] |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> |
Aktuelle Version vom 19. Februar 2013, 13:16 Uhr
Inhaltsverzeichnis |
Action
Return from a subroutine.
Syntax
RETURN
Remarks
Subroutines must be ended with a related RETURN statement.
Interrupt subroutines must also be terminated with the Return statement.
See also
Example
'----------------------------------------------------------------------------------------- 'name : gosub.bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : demo: GOTO, GOSUB and RETURN 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no '----------------------------------------------------------------------------------------- $regfile = "m48def.dat" ' specify the used micro $crystal = 4000000 ' used crystal frequency $baud = 19200 ' use baud rate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space Goto Continue Print "This code will not be executed" Continue: 'end a label with a colon Print "We will start execution here" Gosub Routine Print "Back from Routine" End Routine: 'start a subroutine Print "This will be executed" Return 'return from subroutine
Languages | English • Deutsch |
---|