1
2SECTION code_clib
3SECTION code_l
4
5PUBLIC l_testword_hl
6
7   inc hl
8   inc hl
9
10   inc hl
11   inc hl
12
13l_testword_hl:
14
15   ; Common operation to test if word at offset from hl equals zero
16   ;
17   ; enter : hl = int *address
18   ;
19   ; exit  : if *address == 0
20   ;
21   ;           hl = 1
22   ;           z flag set
23   ;
24   ;         if *address != 0
25   ;
26   ;           hl = 0
27   ;           nz flag set
28   ;
29   ; uses  : af, hl
30
31   ld a,(hl)
32   inc hl
33   or (hl)
34
35   ld hl,0
36   ret nz
37
38   inc l
39   ret
40