lib/cpu/opcodes.js
function sbc (cpu, n) {
    const cy = cpu.f >> 4 & 1;
    const r = cpu.a - n - cy;

    cpu.f = FLAG_N;
    if ((r & 0xff) == 0) cpu.f |= FLAG_Z;
    if (((cpu.a ^ n ^ r) & 0x10) != 0) cpu.f |= FLAG_H;
    if ((r & 0x100) != 0) cpu.f |= FLAG_C;

    return r;
}
function sbc (cpu, n) {
    const cy = cpu.f >> 4 & 1;
    const r = cpu.a - n - cy;

    cpu.f = FLAG_N;
    if ((r & 0xff) == 0) cpu.f |= FLAG_Z;
    if (((cpu.a ^ n ^ r) & 0x10) != 0) cpu.f |= FLAG_H;
    if ((r & 0x100) != 0) cpu.f |= FLAG_C;

    return r;
}
function sbc ( cpu , n ) { const cy = cpu . f >> 4 & 1 ; const r = cpu . a - n - cy ; cpu . f = FLAG_N ; if ( ( r & 0xff ) == 0 ) cpu . f |= FLAG_Z ; if ( ( ( cpu . a ^ n ^ r ) & 0x10 ) != 0 ) cpu . f |= FLAG_H ; if ( ( r & 0x100 ) != 0 ) cpu . f |= FLAG_C ; return r ; }
SBC A,n

Description:
Subtract n + Carry flag from A.

Use with:
n = A, B, C, D, E, H, L, (HL), #

Flags affected:
Z - Set if result is zero.
N - Set.
H - Set if no borrow from bit 4.
C - Set if no borrow.

Opcodes:
Instruction    Parameters    Opcode    Cycles
SBC            A,A           9F        4
SBC            A,B           98        4
SBC            A,C           99        4
SBC            A,D           9A        4
SBC            A,E           9B        4
SBC            A,H           9C        4
SBC            A,L           9D        4
SBC            A,(HL)        9E        8
SBC            A,#           DE        8
SBC A n