Espressif ESP32-S2 Programming Manual page 1498

Table of Contents

Advertisement

Chapter 4. API Guides
NOP
JUMPR
JUMPS –Jump to a relative address (condition based on stage count)
Syntax JUMPS Step, Threshold, Condition
Operands
• Step –relative shift from current position, in bytes
• Threshold –threshold value for branch condition
• Condition:
– EQ (equal) –jump if value in stage_cnt == threshold
– LT (less than) –jump if value in stage_cnt < threshold
– LE (less or equal) - jump if value in stage_cnt <= threshold
– GT (greater than) –jump if value in stage_cnt > threshold
– GE (greater or equal) —jump if value in stage_cnt >= threshold
Cycles 2 cycles to execute, 2 cycles to fetch next instruction:
//
JUMPS target, threshold, EQ
JUMPS next, threshold, LT
JUMPS target, threshold, LE
next:
//
JUMPS target, threshold, GT
JUMPS next, threshold, LE
JUMPS target, threshold, GE
next:
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch,
or 4 cycles to execute + 4 cycles to fetch.
Description The instruction makes a jump to a relative address if condition is true. Condition is the result of
comparison of count register value and threshold value.
Examples:
1:pos:
JUMPS
==
20
2:
//
Up counting loop using stage count register
STAGE_RST
label:
STAGE_INC
NOP
JUMPS
STAGE_RST –Reset stage count register
Syntax STAGE_RST
Operands No operands
Description The instruction sets the stage count register to 0
Cycles 2 cycles to execute, 4 cycles to fetch next instruction
Examples:
1:
STAGE_RST
Espressif Systems
//
do something
label, 1, GE
//
jump to label
is
implemented as:
is
implemented as:
16, 20, EQ
//
Jump to (position
//
1
// stage_cnt++
//
label, 16, LT
//
//
Reset stage count register
Submit Document Feedback
if
R0
>=
+
16
set
stage_cnt to
0
do something
jump to label
if
stage_cnt
1487
(continued from previous page)
1
bytes)
if
stage_cnt␣
<
16
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF