📚 REDCODE-94 INSTRUCTION REFERENCE (18/19)
LDP - Load P-space
LDP: Load from P-space (Persistent Memory)
LDP reads a value from the warrior's private P-space (Persistent Space) slot indexed by operand A and writes that value into destination B in Core memory.
Syntax
LDP.AB #slot, dest ; Load value from P-space[#slot] into dest.B
LDP.B slotPtr, dest ; Load value from P-space[slotPtr.B] into dest.BWhat is P-space?
Introduced in ICWS-94, P-space is a private, tamper-proof array of memory slots belonging exclusively to each warrior:
- Tamper-Proof: Enemy warriors cannot read or overwrite your P-space.
- Persistent Across Rounds: Values stored via
STPsurvive even when Core memory is wiped between multi-round tournament battles. - Slot
#0(Round Outcome): Automatically updated by MARS before each round (0= lost previous round,> 0= won or tied).
Adaptive Strategy Switching ("P-Warriors")
LDP.AB #0, lastResult ; Read outcome of previous round from Slot 0
JMZ.B switchStrat, lastResult ; If 0 (we lost!), switch strategy
JMP.A keepCurrent ; Otherwise keep winning strategy