EasyManua.ls Logo

Espressif ESP32-S2 - Page 1497

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
Description The instruction makes jump to the specified address. Jump can be either unconditional or based on an
ALU flag.
Examples:
1: JUMP R1 // Jump to address in R1 (address in R1 is in
,32-bit words)
2: JUMP 0x120, EQ // Jump to address 0x120 (in bytes) if ALU
,result is zero
3: JUMP label // Jump to label
...
label: nop // Definition of label
4: .global label // Declaration of global label
MOVE R1, label // R1 = label (value loaded into R1 is in words)
JUMP R1 // Jump to label
...
label: nop // Definition of label
JUMPR Jump to a relative offset (condition based on R0)
Syntax JUMPR 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 R0 == threshold
LT (less than) jump if value in R0 < threshold
LE (less or equal) jump if value in R0 <= threshold
GT (greater than) jump if value in R0 > threshold
GE (greater or equal) jump if value in R0 >= threshold
Cycles Conditions EQ, GT and LT: 2 cycles to execute, 2 cycles to fetch next instruction
Conditions LE and GE are implemented in the assembler using two JUMPR instructions:
// JUMPR target, threshold, LE is implemented as:
JUMPR target, threshold, EQ
JUMPR target, threshold, LT
// JUMPR target, threshold, GE is implemented as:
JUMPR target, threshold, EQ
JUMPR target, threshold, GT
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 R0 register value and the threshold value.
Examples:
1:pos: JUMPR 16, 20, GE // Jump to address (position + 16 bytes) if
,value in R0 >= 20
2: // Down counting loop using R0 register
MOVE R0, 16 // load 16 into R0
label: SUB R0, R0, 1 // R0--
(continues on next page)
Espressif Systems 1486
Submit Document Feedback
Release v4.4

Table of Contents