gui2: added OBJ_CountDirectChildren
This commit is contained in:
@@ -1008,6 +1008,30 @@ objGetPredecessor_ret:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine OBJ_CountDirectChildren @global
|
||||||
|
;
|
||||||
|
; @param Y address of object whose children are to be counted
|
||||||
|
; @return r16 number of direct children
|
||||||
|
; @clobbers r18, r19
|
||||||
|
|
||||||
|
OBJ_CountDirectChildren:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
clr r16
|
||||||
|
rcall OBJ_GetFirstChild
|
||||||
|
OBJ_CountDirectChildren_loop:
|
||||||
|
brcc OBJ_CountDirectChildren_done
|
||||||
|
inc r16
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
rcall OBJ_GetNext
|
||||||
|
rjmp OBJ_CountDirectChildren_loop
|
||||||
|
OBJ_CountDirectChildren_done:
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user