Skip to content

incorrect v flag #65

Description

@dtremblay

I posted it in the channel already, trimmed to essentials:

sec
lda _dtop+1
sbc _scratch+1
bvc less_y1
eor #$80

less_y1:
bmi less_true
bvc less_y2
eor #$80
less_y2:
bne less_false
lda _dtop
sbc _scratch
bcc less_true
less_false:
less_true:
This code is intended to do signed compare of _dtop against _scratch. It mostly works, except it will jump to true if one of the operands in -32768. As I said, it is practically identical to Example 6.3 from http://www.6502.org/tutorials/compare_beyond.html. To be honest, I do not completely understand how this is supposed to work in all cases either.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions