adt_QueueFront.asm
bitfixer_bitfixer/dg/z88dk/libsrc/adt/queue/adt_QueueFront.asm
; void *adt_QueueFront(struct adt_Queue *q)
; 09.2005 aralbrec

PUBLIC adt_QueueFront

; enter: HL = struct adt_Queue *
; exit : HL = peek at top item or 0 and carry reset if queue empty

.adt_QueueFront

   inc hl
   inc hl

   ld a,(hl)
   inc hl
   ld h,(hl)
   ld l,a
   
   or h
   ret z

   ld a,(hl)
   inc hl
   ld h,(hl)
   ld l,a
   scf
   ret
