[go: nahoru, domu]

Skip to content
New issue

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

Fix encoding of IN instruction with bit_count == 32 #58

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

jannic
Copy link
Member
@jannic jannic commented Mar 21, 2024

Thanks to @xeniarose for finding and reporting this bug

Fixes #57
Replaces #60

Thanks to @xeniarose for finding and reporting this bug

Fixes rp-rs#57
@devsnek
Copy link
Member
devsnek commented May 27, 2024

maybe add a test?

@9names
Copy link
Member
9names commented May 27, 2024

how about 4 tests?

instr_test!(r#in(InSource::Y, 10), 0b010_00000_010_01010);
instr_test!(r#in(InSource::Y, 32), 0b010_00000_010_00000);

instr_test!(out(OutDestination::Y, 10), 0b011_00000_010_01010);
instr_test!(out(OutDestination::Y, 32), 0b011_00000_010_00000);

#[test]
#[should_panic]
fn test_invalid_in_bit_width_should_panic() {
    let mut a = Assembler::<32>::new();
    a.r#in(InSource::Y, 33);
    a.assemble_program();
}

#[test]
#[should_panic]
fn test_invalid_out_bit_width_should_panic() {
    let mut a = Assembler::<32>::new();
    a.out(OutDestination::X, 33);
    a.assemble_program();
}

@jannic jannic requested a review from devsnek May 28, 2024 10:02
@jannic jannic merged commit 7bd9fda into rp-rs:main Aug 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encoding of IN with bit_count = 32 is incorrect
3 participants