Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions data/transactions/logic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ return stack matches the name of the input value.
| `divw` | A,B / C. Fail if C == 0 or if result overflows. |
| `divmodw` | W,X = (A,B / C,D); Y,Z = (A,B modulo C,D) |
| `expw` | A raised to the Bth power as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low. Fail if A == B == 0 or if the results exceeds 2^128-1 |
| `getbit` | Bth bit of (byte-array or integer) A. |
| `setbit` | Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C |
| `getbyte` | Bth byte of A, as an integer |
| `setbyte` | Copy of A with the Bth byte set to small integer (between 0..255) C |
| `getbit` | Bth bit of (byte-array or integer) A. If B is greater than or equal to the bit length of the value (8*byte length), the program fails |
| `setbit` | Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails |
| `getbyte` | Bth byte of A, as an integer. If B is greater than or equal to the array length, the program fails |
| `setbyte` | Copy of A with the Bth byte set to small integer (between 0..255) C. If B is greater than or equal to the array length, the program fails |
| `concat` | join A and B |

### Byte Array Manipulation
Expand Down
8 changes: 4 additions & 4 deletions data/transactions/logic/TEAL_opcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ See `bnz` for details on how branches work. `b` always jumps to the offset.

- Opcode: 0x53
- Stack: ..., A, B: uint64 → ..., uint64
- Bth bit of (byte-array or integer) A.
- Bth bit of (byte-array or integer) A. If B is greater than or equal to the bit length of the value (8*byte length), the program fails
- Availability: v3

see explanation of bit ordering in setbit
Expand All @@ -721,7 +721,7 @@ see explanation of bit ordering in setbit

- Opcode: 0x54
- Stack: ..., A, B: uint64, C: uint64 → ..., any
- Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C
- Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails
- Availability: v3

When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.
Expand All @@ -730,14 +730,14 @@ When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on

- Opcode: 0x55
- Stack: ..., A: []byte, B: uint64 → ..., uint64
- Bth byte of A, as an integer
- Bth byte of A, as an integer. If B is greater than or equal to the array length, the program fails
- Availability: v3

## setbyte

- Opcode: 0x56
- Stack: ..., A: []byte, B: uint64, C: uint64 → ..., []byte
- Copy of A with the Bth byte set to small integer (between 0..255) C
- Copy of A with the Bth byte set to small integer (between 0..255) C. If B is greater than or equal to the array length, the program fails
- Availability: v3

## extract s l
Expand Down
8 changes: 4 additions & 4 deletions data/transactions/logic/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ var opDocByName = map[string]string{
"concat": "join A and B",
"substring": "A range of bytes from A starting at S up to but not including E. If E < S, or either is larger than the array length, the program fails",
"substring3": "A range of bytes from A starting at B up to but not including C. If C < B, or either is larger than the array length, the program fails",
"getbit": "Bth bit of (byte-array or integer) A.",
"setbit": "Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C",
"getbyte": "Bth byte of A, as an integer",
"setbyte": "Copy of A with the Bth byte set to small integer (between 0..255) C",
"getbit": "Bth bit of (byte-array or integer) A. If B is greater than or equal to the bit length of the value (8*byte length), the program fails",
"setbit": "Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails",
"getbyte": "Bth byte of A, as an integer. If B is greater than or equal to the array length, the program fails",
"setbyte": "Copy of A with the Bth byte set to small integer (between 0..255) C. If B is greater than or equal to the array length, the program fails",
"extract": "A range of bytes from A starting at S up to but not including S+L. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails",
"extract3": "A range of bytes from A starting at B up to but not including B+C. If B+C is larger than the array length, the program fails",
"extract_uint16": "A uint16 formed from a range of big-endian bytes from A starting at B up to but not including B+2. If B+2 is larger than the array length, the program fails",
Expand Down