STORE
Write a constant value or framed register to a memory location.
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $63 | 3 | 3 | STORE [I:_], B:_ | STORE [I:4], B:8 |
| $64 | 3 | 3 | STORE [I:_], P:_ | STORE [I:4], P:8 |
| $65 | 3 | 3 | STORE [I:_], I:_ | STORE [I:4], I:8 |
| $C0 | 4 | 3 | STORE [I:_ + {S_BYTE}], B:_ | STORE [I:4 + 123], B:8 |
| $C1 | 4 | 3 | STORE [I:_ + {S_BYTE}], P:_ | STORE [I:4 + 123], P:8 |
| $C2 | 4 | 3 | STORE [I:_ + {S_BYTE}], I:_ | STORE [I:4 + 123], I:8 |
| $EF | 5 | 3 | STORE [I:_ + {S_PAIR}], B:_ | STORE [I:4 + 12345], B:8 |
| $F0 | 5 | 3 | STORE [I:_ + {S_PAIR}], P:_ | STORE [I:4 + 12345], P:8 |
| $F1 | 5 | 3 | STORE [I:_ + {S_PAIR}], I:_ | STORE [I:4 + 12345], I:8 |
| $67 | 3 | 3 | STORE [I:_], BYTE {BYTE} | STORE [I:4], BYTE 123 |
| $68 | 3 | 3 | STORE [I:_], PAIR {S_BYTE} | STORE [I:4], PAIR 123 |
| $6A | 3 | 3 | STORE [I:_], INT {S_BYTE} | STORE [I:4], INT 123 |
| $C6 | 4 | 3 | STORE [I:_ + {S_BYTE}], BYTE {BYTE} | STORE [I:4 + 123], BYTE 123 |
| $C7 | 4 | 3 | STORE [I:_ + {S_BYTE}], PAIR {S_BYTE} | STORE [I:4 + 123], PAIR 123 |
| $C9 | 4 | 3 | STORE [I:_ + {S_BYTE}], INT {S_BYTE} | STORE [I:4 + 123], INT 123 |
| $F5 | 5 | 3 | STORE [I:_ + {S_PAIR}], BYTE {BYTE} | STORE [I:4 + 12345], BYTE 123 |
| $F6 | 5 | 3 | STORE [I:_ + {S_PAIR}], PAIR {S_BYTE} | STORE [I:4 + 12345], PAIR 123 |
| $F8 | 5 | 3 | STORE [I:_ + {S_PAIR}], INT {S_BYTE} | STORE [I:4 + 12345], INT 123 |
These special forms allow 24-bit memory addresses to be compactly stored as a TRIO data type:
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $69 | 3 | 3 | STORE [I:_], TRIO {S_BYTE} | STORE [I:4], TRIO 123 |
| $C8 | 4 | 3 | STORE [I:_ + {S_BYTE}], TRIO {S_BYTE} | STORE [I:4 + 123], TRIO 123 |
| $F7 | 5 | 3 | STORE [I:_ + {S_PAIR}], TRIO {S_BYTE} | STORE [I:4 + 12345], TRIO 123 |
| $6D | 3 | 3 | STORE TRIO [I:_], I:_ | STORE TRIO [I:4], I:8 |
| $CC | 4 | 3 | STORE TRIO [I:_ + {S_BYTE}], I:_ | STORE TRIO [I:4 + 123], I:8 |
| $FB | 5 | 3 | STORE TRIO [I:_ + {S_PAIR}], I:_ | STORE TRIO [I:4 + 12345], I:8 |
Notes
-
The left operand is the target where the output will go.
-
For example,
STORE [I:4], P:8writes the value ofP:8to the memory address indicated byI:4. BecauseP:8is aPAIRregister, two bytes will be stored. -
For example,
STORE [I:4 + 123], P:6stores the value ofP:6to the addressI:4plus offset123. BecauseP:6is aPAIRregister, two bytes will be stored. In the Hybrix language, this form is often used to assign class members, whose fields are located at fixed offsets from the object's address. -
For example,
STORE [I:4], PAIR 12345writes the literal value 12,345 at the address indicated byI:4. We must include thePAIRtype specifier, because by itself 12,345 doesn't indicate how many bytes to write. -
This instruction does not affect the CPU condition flags.