| Routines

6264: Copy two bytes from a command list into a character's buffer

Used by the routines at 61F8, 62D0, 6464, 717C, 7CE1 and F7D7. Copies a routine address or pair of parameters from a character's current command list into his buffer.
Input
H | Character number (0xB7-0xD6)
L | Destination for the copied bytes
6264 | PUSH DE | Save DE
6265 | PUSH HL | Save the pointer to the character's buffer
6266 | LD L,$19 | Collect into DE the address of the point reached in the command list (stored in bytes 0x19 and 0x1A of the character's buffer)
6268 | LD E,(HL)
6269 | INC L
626A | LD D,(HL)
626B | POP HL | Restore the pointer to the character's buffer
626C | LD A,(DE) | Collect the first byte from the command list and copy it to the character's buffer
626D | INC DE
626E | LD (HL),A
626F | INC L | Move along one byte in the character's buffer
6270 | LD A,(DE) | Collect the second byte from the command list and copy it to the character's buffer
6271 | INC DE
6272 | LD (HL),A
6273 | DEC L | Move back again in the character's buffer
6274 | LD A,L | Save L temporarily
6275 | LD L,$19 | Update the address reached in the command list (stored in bytes 0x19 and 0x1A of the character's buffer)
6277 | LD (HL),E
6278 | INC L
6279 | LD (HL),D
627A | POP DE | Restore DE
627B | LD L,A | Restore L
627C | RET |