l_long_eq.asm
bitfixer_bitfixer/dg/z88dk/libsrc/_DEVELOPMENT/l/sccz80/crt0_long/l_long_eq.asm
;       Z88 Small C+ Run Time Library 
;       Long functions
;

SECTION code_clib
SECTION code_l_sccz80

PUBLIC l_long_eq

l_long_eq:

   ; dehl == secondary?  carry if true
   ;
   ; dehl  = primary
   ; stack = secondary, ret
   
   pop ix
   
   pop bc
   
   ld a,c
   cp l
   jr nz, notequal_0
   
   ld a,b
   cp h
   jr nz, notequal_0
   
   pop bc
   
   ld a,c
   cp e
   jr nz, notequal_1
   
   ld a,b
   cp d
   jr nz, notequal_1

equal:

   scf
   jp (ix)

notequal_0:

   pop bc

notequal_1:

   or a
   jp (ix)
