[Z88dk-commits] CVS: z88dk/libsrc/_DEVELOPMENT/adt/ba_priority_queue

Bridge to the z88dk-commits mailing list
Post Reply
alvin

[Z88dk-commits] CVS: z88dk/libsrc/_DEVELOPMENT/adt/ba_priority_queue

Post by alvin »

Update of /cvsroot/z88dk/z88dk/libsrc/_DEVELOPMENT/adt/ba_priority_queue/z80
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5345/ba_priority_queue/z80

Modified Files:
__b_heap_sift_down.asm
Log Message:
an exit point assumed there was one more item on the stack than there actually was

Index: __b_heap_sift_down.asm
===================================================================
RCS file: /cvsroot/z88dk/z88dk/libsrc/_DEVELOPMENT/adt/ba_priority_queue/z80/__b_heap_sift_down.asm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** __b_heap_sift_down.asm 17 Mar 2014 07:08:40 -0000 1.1
--- __b_heap_sift_down.asm 29 Mar 2014 05:01:25 -0000 1.2
***************
*** 50,54 ****

; hl = child_index
- ; de = & array[parent_index]
; bc = array
; stack = n, & array[parent_index], child_index
--- 50,53 ----
***************
*** 157,161 ****
; hl = & array[child]
; de = & array[parent]
! ; stack = n (*2), child_index (*2), array

ld c,(hl)
--- 156,160 ----
; hl = & array[child]
; de = & array[parent]
! ; stack = n, child_index, array

ld c,(hl)
***************
*** 167,171 ****
ex de,hl ; de = & array[child]
pop bc ; bc = array
! pop hl ; hl = child_index (*2)

; child becomes parent
--- 166,170 ----
ex de,hl ; de = & array[child]
pop bc ; bc = array
! pop hl ; hl = child_index

; child becomes parent
***************
*** 237,241 ****

or a
! jp p, error_znc - 3 ; if array[child] >= array[parent], parent is in right place

; swap(array[child], array[parent])
--- 236,240 ----

or a
! jp p, error_znc - 2 ; if array[child] >= array[parent], parent is in right place

; swap(array[child], array[parent])


------------------------------------------------------------------------------
Post Reply