Espressif ESP32-S2 Programming Manual page 1491

Table of Contents

Advertisement

Chapter 4. API Guides
1:
OR R1, R2, R3
2:
OR R1, R2,
3:
.set value1,
OR R1, R2, value1
4:
.global
label
OR R1, R2, label
...
label: nop
LSH - Logical Shift Left
Syntax LSH Rdst, Rsrc1, Rsrc2
LSH 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 does logical shift to left of source register to number of bits from another source register
or 16-bit signed value and store result to the destination register.
Examples:
1:
LSH R1, R2, R3
2:
LSH R1, R2,
3:
.set value1,
LSH R1, R2, value1
4:
.global
label
LSH R1, R2, label
...
label:
nop
RSH - Logical Shift Right
Syntax RSH Rdst, Rsrc1, Rsrc2
RSH 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 does logical shift to right of source register to number of bits from another source
register or 16-bit signed value and store result to the destination register.
Examples:
1:
RSH R1, R2, R3
2:
RSH R1, R2,
3:
.set value1,
RSH R1, R2, value1
4:
.global
label
Espressif Systems
//R1
=
0x1234
//R1
=
0x03
//constant
//R1
=
//declaration of variable label
//R1
=
//definition of variable label
//R1
0x03
//R1
0x03
//constant
//R1
//declaration of variable label
//R1
//definition of variable label
//R1
0x03
//R1
0x03
//constant
//R1
//declaration of variable label
Submit Document Feedback
R2
\|
R3
R2
\|
0x1234
value1=0x03
R2
\|
value1
R2 \|label
=
R2
<<
R3
=
R2
<<
0x03
value1=0x03
=
R2
<<
value1
=
R2
<<
label
=
R2
>>
R3
=
R2
>>
0x03
value1=0x03
=
R2
>>
value1
1480
(continues on next page)
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?

Table of Contents

Save PDF