SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
Subtract 16-Bit Unsigned Constant from Stack Pointer, Result to Register
SUB ucst16, SP, dst
Functional unit = D
32 bit
31 | 16 | 15 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 0 |
ucst16 | dst | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
16 | 3 | opcode |
Subtract a 16-bit unsigned constant (ucst16) from the stack pointer (SP) and store result to dst.
CSR[2]EQ = (dst == 0)
CSR[5]C = {not borrow} from (SP - ucst16)
CSR[7]V = {overflow} from (SP - ucst16)
Note that the carry (CSR:C) and overflow (CSR:V) bits are relevant to unsigned and signed operations, respectively. Appropriate bits are checked depending on if the operands are represented (or, interpreted) as unsigned or signed numbers.
dst = SP - ucst16