Chapter 4. API Guides
Difference between ESP32 ULP and ESP32-S2 ULP Instruction sets
Compare to the ESP32 ULP coprocessor, the ESP-S2 ULP coprocessor has extended instruction set. The ESP32-S2
ULP is not binary compatible with ESP32 ULP, but the assembled program that was written for the ESP32 ULP
will also work on the ESP32-S2 ULP after rebuild. The list of the new instructions that was added to the ESP32-S2
ULP is: LDL, LDH, STO, ST32, STI32. The detailed description of these commands please see below.
NOP - no operation
Syntax NOP
Operands None
Cycles 2 cycle to execute, 4 cycles to fetch next instruction
Description No operation is performed. Only the PC is incremented.
Example:
1: NOP
ADD - Add to register
Syntax ADD Rdst, Rsrc1, Rsrc2
ADD Rdst, Rsrc1, imm
Operands
• Rdst - Register R[0..3]
• Rsrc1 - Register R[0..3]
• Rsrc2 - Register R[0..3]
• Imm - 16-bit signed value
Cycles 2 cycles to execute, 4 cycles to fetch next instruction
Description The instruction adds source register to another source register or to a 16-bit signed value and stores
result to the destination register.
Examples:
1: ADD R1, R2, R3 //R1 = R2 + R3
2: Add R1, R2, 0x1234 //R1 = R2 + 0x1234
3: .set value1, 0x03 //constant value1=0x03
Add R1, R2, value1 //R1 = R2 + value1
4: .global label //declaration of variable label
Add R1, R2, label //R1 = R2 + label
...
label: nop //definition of variable label
SUB - Subtract from register
Syntax SUB Rdst, Rsrc1, Rsrc2
SUB Rdst, Rsrc1, imm
Operands
• Rdst - Register R[0..3]
• Rsrc1 - Register R[0..3]
• Rsrc2 - Register R[0..3]
• Imm - 16-bit signed value
Cycles 2 cycles to execute, 4 cycles to fetch next instruction
Espressif Systems 1478
Submit Document Feedback
Release v4.4