EasyManua.ls Logo

Espressif ESP32-S2 - Page 1493

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)
.text //Text section definition
MOVE R1, 1 // R1 = 1
MOVE R2, Addr1 // R2 = Addr1
STL R1, R2, offs // MEM[R2 + 0] = R1
// MEM[Addr1 + 0] will be 32'hxxxx0001
3:
MOVE R1, 1 // R1 = 1
STL R1, R2, 0x12,1 // MEM[R2+0x12] 0xxxxx4001
STH Store data to the high 16 bits of 32-bits memory
Syntax STH Rsrc, Rdst, oset, Label
Operands
Rsrc Register R[0..3], holds the 16-bit value to store
Rdst Register R[0..3], address of the destination, in 32-bit words
Oset 11-bit signed value, offset in bytes
Label 2-bit user defined unsigned value
Cycles 4 cycles to execute, 4 cycles to fetch next instruction
Description The instruction stores the 16-bit value of Rsrc to the high half-word of memory with address
Rdst+oset:
Mem[Rdst + offset / 4]{31:16} = {Rsrc[15:0]}
Mem[Rdst + offset / 4]{31:16} = {Label[1:0],Rsrc[13:0]}
Examples:
1: STH R1, R2, 0x12 //MEM[R2+0x12][31:16] = R1
2: .data //Data section definition
Addr1: .word 123 // Define label Addr1 16 bit
.set offs, 0x00 // Define constant offs
.text //Text section definition
MOVE R1, 1 // R1 = 1
MOVE R2, Addr1 // R2 = Addr1
STH R1, R2, offs // MEM[R2 + 0] = R1
// MEM[Addr1 + 0] will be 32'h0001xxxx
3:
MOVE R1, 1 // R1 = 1
STH R1, R2, 0x12, 1 //MEM[R2+0x12] 0x4001xxxx
STO Set offset value for auto increment operation
Syntax STO oset
Operands
Oset 11-bit signed value, offset in bytes
Cycles 4 cycles to execute, 4 cycles to fetch next instruction
Description The instruction set 16-bit value to the offset register:
offset = value/ 4
Examples:
1: STO 0x12 // Offset = 0x12/4
2: .data //Data section definition
Addr1: .word 123 // Define label Addr1 16 bit
.set offs, 0x00 // Define constant offs
(continues on next page)
Espressif Systems 1482
Submit Document Feedback
Release v4.4

Table of Contents