Prev: A1AF Up: Map Next: A20C
A1C7: Process Memory Entry
Follows one linked record, stores its link, and clears the marker after that link.
ProcessMemoryEntry A1C7 PUSH HL Save the pointer, the source and the character record.
A1C8 PUSH DE
A1C9 PUSH IX
A1CB POP HL Step back over the block header and point IX at the free-space list (9FE3).
A1CC DEC HL
A1CD DEC HL
A1CE DEC HL
A1CF LD IX,$9FE3
ProcessMemoryEntry_Loop A1D3 LD E,(IX+$00) Read the record's flag byte and read the moved marker.
A1D6 LD D,(IX+$01)
A1D9 LD A,D Jump ahead to ProcessMemoryEntry_Next if the pointer is zero.
A1DA OR E
A1DB JR Z,ProcessMemoryEntry_Next
A1DD PUSH HL Compare HL with DE, keeping a copy of HL.
A1DE AND A
A1DF SBC HL,DE
A1E1 POP HL Restore HL from the stack.
A1E2 JR C,ProcessMemoryEntry_Next Jump ahead to ProcessMemoryEntry_Next if HL was below DE.
A1E4 INC DE Step the source on two bytes, copy it into the record, and go to ProcessMemoryEntry_Loop.
A1E5 INC DE
A1E6 PUSH DE
A1E7 POP IX
A1E9 JR ProcessMemoryEntry_Loop
Stores the link in the record flag, clears the marker after that link, and stores the source address.
ProcessMemoryEntry_Next A1EB LD (IX+$00),L Store the record's flag byte and store the moved marker.
A1EE LD (IX+$01),H
A1F1 INC HL
A1F2 LD (HL),$00 Clear the marker after the link.
A1F4 INC HL Call CalculatePointerOffset to calculate pointer offset.
A1F5 LD (HL),E
A1F6 INC HL
A1F7 LD (HL),D
A1F8 CALL CalculatePointerOffset
A1FB JR Z,ProcessMemoryEntry_Call Go to ProcessMemoryEntry_Call if the offset meets this pointer.
A1FD LD L,(IX+$00) Read the link word.
A200 LD H,(IX+$01)
A203 PUSH HL Copy the link word from HL into IX.
A204 POP IX
ProcessMemoryEntry_Call A206 CALL CalculatePointerOffset Call CalculatePointerOffset to calculate pointer offset.
A209 POP DE
A20A POP HL
A20B RET Return.
Prev: A1AF Up: Map Next: A20C