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

allow odd number of characters in hex constants #1302

Open
hackaugusto opened this issue Mar 27, 2024 · 2 comments
Open

allow odd number of characters in hex constants #1302

hackaugusto opened this issue Mar 27, 2024 · 2 comments
Labels
assembly Related to Miden assembly bug Something isn't working enhancement New feature or request

Comments

@hackaugusto
Copy link
Contributor

the following code:

begin
    push.0x100
end

fails to assemble with the following error code:

Failed to parse program file `t.masm` - parsing error at [2:5]: malformed instruction 'push.0x100', parameter 0x100 is invalid: hex string '100' does not contain an even number of characters

However, 0x100 is a valid representation of the number 128. As an example, the following program:

fn main() {
    println!("{}", format!("0x{:02x}", 256));
}

Will print 0x100 when executed. This is causing test failures in miden-base when similar logic is used to format an account id for testing.

@hackaugusto hackaugusto added bug Something isn't working enhancement New feature or request assembly Related to Miden assembly labels Mar 27, 2024
@Bisht13
Copy link

Bisht13 commented Apr 28, 2024

Is this fixed? If not, I can pick this up.

@bitwalker
Copy link
Contributor

I believe the parser still requires there to be an even number of hex digits, so I believe this is still an open issue @Bisht13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assembly Related to Miden assembly bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants