Skip to content

Complete instruction parser for all 50+ instructions #1

Description

@kevinamccorvon

Right now the parser in zkir-assembler/src/parser.rs only handles 3 instructions (ecall, ebreak, halt). Everything else is missing. Need to add all the R-type instructions (add, sub, mul, div, and, or, xor, sll, srl, sra, slt, sltu), I-type ALU stuff (addi, andi, ori, xori, slli, srli, srai, slti, sltiu), I-type loads (lb, lh, lw, lbu, lhu), S-type stores (sb, sh, sw), B-type branches (beq, bne, blt, bge, bltu, bgeu), J-type jumps (jal, jalr), U-type (lui, auipc), and all the ZK-specific instructions (zk_input, zk_output, zk_hint, zk_commit, etc.).

Each instruction type has different operand formats so need to handle registers, immediates, offsets properly. Would be good to add tests for each type, both valid and invalid cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions