Skip to main content

STORE

Write a constant value or framed register to a memory location.

OpcodeBytesCyclesFormExample
$6333STORE [I:_], B:_STORE [I:4], B:8
$6433STORE [I:_], P:_STORE [I:4], P:8
$6533STORE [I:_], I:_STORE [I:4], I:8
$C043STORE [I:_ + {S_BYTE}], B:_STORE [I:4 + 123], B:8
$C143STORE [I:_ + {S_BYTE}], P:_STORE [I:4 + 123], P:8
$C243STORE [I:_ + {S_BYTE}], I:_STORE [I:4 + 123], I:8
$EF53STORE [I:_ + {S_PAIR}], B:_STORE [I:4 + 12345], B:8
$F053STORE [I:_ + {S_PAIR}], P:_STORE [I:4 + 12345], P:8
$F153STORE [I:_ + {S_PAIR}], I:_STORE [I:4 + 12345], I:8
$6733STORE [I:_], BYTE {BYTE}STORE [I:4], BYTE 123
$6833STORE [I:_], PAIR {S_BYTE}STORE [I:4], PAIR 123
$6A33STORE [I:_], INT {S_BYTE}STORE [I:4], INT 123
$C643STORE [I:_ + {S_BYTE}], BYTE {BYTE}STORE [I:4 + 123], BYTE 123
$C743STORE [I:_ + {S_BYTE}], PAIR {S_BYTE}STORE [I:4 + 123], PAIR 123
$C943STORE [I:_ + {S_BYTE}], INT {S_BYTE}STORE [I:4 + 123], INT 123
$F553STORE [I:_ + {S_PAIR}], BYTE {BYTE}STORE [I:4 + 12345], BYTE 123
$F653STORE [I:_ + {S_PAIR}], PAIR {S_BYTE}STORE [I:4 + 12345], PAIR 123
$F853STORE [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:

OpcodeBytesCyclesFormExample
$6933STORE [I:_], TRIO {S_BYTE}STORE [I:4], TRIO 123
$C843STORE [I:_ + {S_BYTE}], TRIO {S_BYTE}STORE [I:4 + 123], TRIO 123
$F753STORE [I:_ + {S_PAIR}], TRIO {S_BYTE}STORE [I:4 + 12345], TRIO 123
$6D33STORE TRIO [I:_], I:_STORE TRIO [I:4], I:8
$CC43STORE TRIO [I:_ + {S_BYTE}], I:_STORE TRIO [I:4 + 123], I:8
$FB53STORE 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:8 writes the value of P:8 to the memory address indicated by I:4. Because P:8 is a PAIR register, two bytes will be stored.

  • For example, STORE [I:4 + 123], P:6 stores the value of P:6 to the address I:4 plus offset 123. Because P:6 is a PAIR register, 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 12345 writes the literal value 12,345 at the address indicated by I:4. We must include the PAIR type specifier, because by itself 12,345 doesn't indicate how many bytes to write.

  • This instruction does not affect the CPU condition flags.