Chapter 4. API Guides
(continued from previous page)
RSH R1, R2, label //R1 = R2 >> label
label: nop //definition of variable label
MOVE –Move to register
Syntax MOVE Rdst, Rsrc
MOVE Rdst, imm
Operands
• Rdst –Register R[0..3]
• Rsrc –Register R[0..3]
• Imm –16-bit signed value
Cycles 2 cycles to execute, 4 cycles to fetch next instruction
Description The instruction move to destination register value from source register or 16-bit signed value.
Note that when a label is used as an immediate, the address of the label will be converted from bytes to words.
This is because LD, ST, and JUMP instructions expect the address register value to be expressed in words
rather than bytes. To avoid using an extra instruction
Examples:
1: MOVE R1, R2 //R1 = R2
2: MOVE R1, 0x03 //R1 = 0x03
3: .set value1, 0x03 //constant value1=0x03
MOVE R1, value1 //R1 = value1
4: .global label //declaration of label
MOVE R1, label //R1 = address_of(label) / 4
...
label: nop //definition of label
STL/ST –Store data to the low 16 bits of 32-bits memory
Syntax ST Rsrc, Rdst, offset, Label STL Rsrc, Rdst, offset, 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
• Offset –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 lower half-word of memory with address
Rdst+offset:
Mem[Rdst + offset / 4]{15:0} = {Rsrc[15:0]}
Mem[Rdst + offset / 4]{15:0} = {Label[1:0],Rsrc[13:0]}
The ST command introduced to make compatibility with previous versions of UPL core. The application can
use higher 16 bits to determine which instruction in the ULP program has written any particular word into
memory.
Examples:
1: STL R1, R2, 0x12 //MEM[R2+0x12] = R1
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 1481
Submit Document Feedback
Release v4.4