END/de
(→Beispiel) |
(→See also) |
||
Line 43: | Line 43: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Siehe auch</span> = |
[[STOP]] | [[STOP]] |
Revision as of 00:54, 19 February 2013
Contents |
Funktion
Beendet die Programmausführung.
Syntax
END
Remarks
STOP can also be used to terminate a program.
When an END statement is encountered, all interrupts are disabled and a never-ending loop is generated.
When a STOP is encountered the interrupts will not be disabled. Only a never ending loop will be created.
In an embedded application you probably do not want to end the application. But there are cases where you do want to end the application. For example when you control some motors, and you determine a failure, you do not want to use a Watchdog reset because then the failure will occur again. In that case you want to display an error, and wait for service personal to fix the failure.
It is important to notice that without the END statement, your program can behave strange in certain cases. For example :
Print "Hello"
Note that there is no END statement. So what will happen? The program will print "Hello". But as the compiler places the library code behind the program code, the micro will execute the library code ! But without being called. As most library code are assembler sub routines that end with a RET, your program will most likely crash, or reset and repeat for ever.
Siehe auch
Beispiel
Print "Hallo" 'serielle Ausgabe End 'Programmausführung beenden und alle Interrupts disablen
Languages | English • Deutsch |
---|