Skip to content

Instantly share code, notes, and snippets.

@gnacu
Last active March 9, 2017 22:00
Show Gist options
  • Save gnacu/ea09c146771c6e71a1f7f9515cdfb001 to your computer and use it in GitHub Desktop.
Save gnacu/ea09c146771c6e71a1f7f9515cdfb001 to your computer and use it in GitHub Desktop.
nextnode ;Check if last sibling ptr is 0
lda lptr+1
bne chkchild
;Set this struct as the first
;child of its parent struct
#copyptr ptr,child
chkchild lda children
beq nextrow ;In root menu
dec children
bne nextrow
rts ;Return to parent
;Set this struct as the?previus
;sibling of the next struct
nextrow #copyptr ptr,lptr
jmp parserow
children .byte 0
child .byte 0,0 ;non-ZP Pointer
.bend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment