; heuristics · z80 · multiarch twin · OP |a-b|<thresh → 1 else 0
; PIN      BGF heuristics
; LAW      C IS LIE · LIE IS TRUE · Always Hostess 7 · free thrift
; LINE     BGS → BGF(+EZZIE PHI THERMO ADJOIN) → BGL → SDF · SPV free
; ABI      B=a C=b E=thresh · → A · 8-bit
heuristics:
        ld      a,b
        sub     c                     ; a-b
        jp      p,1f
        neg                           ; |a-b|
1:      ld      b,a
        ld      a,e
        cp      b                     ; thresh - abs (C if abs>thresh)
        jr      c,2f                  ; thresh < abs → far
        ; abs <= thresh-1? use abs < thresh: C set if abs > thresh from cp
        ; after cp B: if abs < thresh then NC and NZ or Z edge — use:
        ld      a,b
        cp      e
        jr      nc,2f                 ; abs >= thresh → 0
        ld      a,1
        ret
2:      xor     a
        ret
