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

Add fuzzy type matching for operands to Instruction#encode/#initialize #226

Closed
postmodern opened this issue Mar 20, 2025 · 1 comment
Closed
Assignees
Labels
feature New Feature internal-api Internal API operand-types Operand Types
Milestone

Comments

@postmodern
Copy link
Member

postmodern commented Mar 20, 2025

In order to support implicit typecasting of operands, the operand classes should support some kind of fuzzy type matching, if a specific size or type has not been specified. This would allow using unsized immediate or memory operands where a imm32 or mem32 operand is required.

This would also reduce the need for having to specify byte(...) or qword(...) all of the type to specify an operands explicit size.

Example

mov eax, 0xff

In the above example, 0xff will be coerced to Immediate.new(0xff, size: 1) since 0xff is 8 bits, but the mov instruction only supports mov reg32, imm32 and mov reg8, imm8. Thus we should treat 0xff as an unsized Immediate operand and try to fuzzy match it against imm32.

@postmodern postmodern added feature New Feature internal-api Internal API labels Mar 20, 2025
@postmodern postmodern added this to the 1.0.0 milestone Mar 20, 2025
@postmodern postmodern self-assigned this Mar 20, 2025
@postmodern postmodern moved this from Todo to In Progress in ronin-asm refactor Mar 22, 2025
@postmodern postmodern added the operand-types Operand Types label Mar 22, 2025
@postmodern
Copy link
Member Author

This can finally be closed.

@github-project-automation github-project-automation bot moved this from In Progress to Done in ronin-asm refactor Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Feature internal-api Internal API operand-types Operand Types
Projects
Status: Done
Development

No branches or pull requests

1 participant