Skip to content

Add instruction enum and parser#1

Merged
atar13 merged 3 commits intomainfrom
add-instruction-enum-parser
Feb 6, 2025
Merged

Add instruction enum and parser#1
atar13 merged 3 commits intomainfrom
add-instruction-enum-parser

Conversation

@Samir-Rashid
Copy link
Copy Markdown
Owner

@Samir-Rashid Samir-Rashid commented Jan 28, 2025

Add an enum of all ARM and RISC-V instructions and implement a parser from a text file of asm to the instruction enums.

  • Instruction Enum: Add Instruction enum in src/instruction.rs with all ARM and RISC-V instructions.
  • Parser Implementation: Implement parse_asm function in src/main.rs to parse asm text files into Instruction enums.
  • Binary Translation: Update binary_translate function in src/main.rs to use parse_asm for translation.
  • Dependencies: Add strum and strum_macros dependencies in Cargo.toml for enum parsing.
  • Tests: Add tests in test/parse_asm.rs to verify parsing functionality and in test/binary_translate.rs to verify translation functionality.

@Samir-Rashid Samir-Rashid requested a review from trdavidt January 28, 2025 22:20
@Samir-Rashid Samir-Rashid self-assigned this Jan 28, 2025
@Samir-Rashid Samir-Rashid added the enhancement New feature or request label Jan 28, 2025
@Samir-Rashid Samir-Rashid requested a review from atar13 January 28, 2025 22:21
Samir-Rashid and others added 3 commits January 28, 2025 14:41
Add an enum of all (supported) ARM and RISC-V instructions and implement a parser from a text file of asm to the instruction enums.

* **Instruction Enum**: Add `Instruction` enum in `src/instruction.rs` with all ARM and RISC-V instructions.
* **Parser Implementation**: Implement `parse_asm` function in `src/main.rs` to parse asm text files into `Instruction` enums.
* **Binary Translation**: Update `binary_translate` function in `src/main.rs` to use `parse_asm` for translation.
* **Dependencies**: Add `strum` and `strum_macros` dependencies in `Cargo.toml` for enum parsing.
* **Tests**: Add tests in `test/parse_asm.rs` to verify parsing functionality and in `test/binary_translate.rs` to verify translation functionality.
@Samir-Rashid Samir-Rashid force-pushed the add-instruction-enum-parser branch from d0c0b6e to c0d1a32 Compare January 28, 2025 22:45
@atar13 atar13 merged commit 6273c5b into main Feb 6, 2025
@gmax9
Copy link
Copy Markdown

gmax9 commented Feb 6, 2025

dis i like.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants