def METHOD_NAME(a, b, previous_value):
    """to done should subtract the"""
    RAM[vars.a] = a
    RAM[vars.b] = b
    RAM[vars.result : vars.result + 2] = (previous_value + 1).to_bytes(
        2, "little", signed=False
    )
    Emulator.Y = asm.symbol("Quarter-squares lookup table") >> 8
    Emulator.next_instruction = asm.symbol(".after-first-lookup") + 2
    expected = (previous_value - math.floor((a - b) ** 2 / 4)) & 0xFFFF
    cycles = Emulator.run_to(asm.symbol("done"))
    assert expected == int.from_bytes(
        RAM[vars.result : vars.result + 2], "little", signed=False
    )
    assert asm.symbol("Quarter-squares lookup table") >> 8 == Emulator.Y
    assert vars.cost_of_7bit_multiply - vars.cost_after_first_lookup - 2 == cycles