EasyManua.ls Logo

Espressif ESP32-S2 - Page 1498

Espressif ESP32-S2
1695 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 4. API Guides
(continued from previous page)
NOP // do something
JUMPR label, 1, GE // jump to label if R0 >= 1
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 is implemented as:
JUMPS next, threshold, LT
JUMPS target, threshold, LE
next:
// JUMPS target, threshold, GT is implemented as:
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 16, 20, EQ // Jump to (position + 16 bytes) if stage_cnt
,== 20
2: // Up counting loop using stage count register
STAGE_RST // set stage_cnt to 0
label: STAGE_INC 1 // stage_cnt++
NOP // do something
JUMPS label, 16, LT // jump to label if stage_cnt < 16
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 // Reset stage count register
Espressif Systems 1487
Submit Document Feedback
Release v4.4

Table of Contents