Jump Statements - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers

Jump Statements

A jump statement, when executed, transfers control unconditionally. There are four
such statements in mikroC:
Break Statement
Sometimes, you might need to stop the loop from within its body. Use the
statement within loops to pass control to the first statement following the inner-
most
Break
positive match. For example:
switch (state) {
case 0: Lo();
case 1: Mid(); break;
case 2: Hi();
default: Message("Invalid state!");
}
Continue Statement
You can use the
cycle". It passes control to the end of the innermost enclosing end brace belonging
to a looping construct. At that point the loop continuation condition is re-evaluat-
ed. This means that continue demands the next iteration if loop continuation con-
dition is true.
Goto Statement
Use the
mation on labels, refer to Labeled Statements. Syntax of
goto label_identifier ;
This will transfer control to the location of a local label specified by
label_identifier
within the same function in which the
before or after the label.
page
122
break
,
,
, or
switch
for
while
is commonly used in
break;
break;
statement within loops (
continue
statement to unconditionally jump to a local label — for more infor-
goto
. The
label_identifier
MikroElektronika: Development tools - Books - Compilers
,
,
continue
goto
block.
do
statements to stop its execution upon the first
switch
has to be a name of the label
statement is. The
goto
making it simple...
, and
.
return
break
,
,
) to "skip the
while
do
for
statement is:
goto
line can come
goto
mikroC

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents