We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRPLA EQU $FDE2 LDX #>PRPLA-1
Should assemble to A2 FD, not A2 FE.
A2 FD
A2 FE
I think this is happening because num is unsigned, so -1 becomes 0xFFFF (then saved as 0xFF).
num
-1
0xFFFF
0xFF
Adding 0xFF to 0xFDE2 results in 0xFEE1 and the high-byte 0xFE is returned.
0xFDE2
0xFEE1
0xFE
Repro
func TestHighByteSubtraction(t *testing.T) { out := bytes.NewBuffer(nil) prg := strings.NewReader(` PRPLA EQU $FDE2 LDX #>PRPLA-1 `) _, err := Assemble(out, prg, true) if err != nil { t.Error(err) return } // 0000- A2 FD LDX #>PRPLA-1 expected := []byte("\xA2\xFD") actual := out.Bytes() if !bytes.Equal(expected, actual) { t.Errorf("Expected %v; got %v", expected, actual) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Should assemble to
A2 FD
, notA2 FE
.I think this is happening because
num
is unsigned, so-1
becomes0xFFFF
(then saved as0xFF
).Adding
0xFF
to0xFDE2
results in0xFEE1
and the high-byte0xFE
is returned.Repro
The text was updated successfully, but these errors were encountered: