Prev: 795E Up: Map Next: 799E
798D: Linked List : Create.
Used by the routine at LinkList_bee4_setup.
Input
B Number of links
C Size of link in bytes.
DE Ptr to first link.
Output
Creates a linked list by storing the ptr to the next link in the first two bytes of the current link.
LinkedList_Create 798D DEC B
LinkedList_Create_0 798E LD L,C Create ptr to next link using link size.
798F LD H,$00
7991 ADD HL,DE
7992 EX DE,HL
7993 LD (HL),E Store ptr to next link in first 2 bytes of link.
7994 INC HL
7995 LD (HL),D
7996 DJNZ LinkedList_Create_0 Next link.
7998 EX DE,HL Terminate list with zeroes in last link.
7999 XOR A
799A LD (HL),A
799B INC HL
799C LD (HL),A
799D RET
Prev: 795E Up: Map Next: 799E