Crate lib_rv32_asm

Source

Re-exports§

pub use lib_rv32_common as common;

Modules§

encode
Functions for encoding integers as instruction fields.
error
Errors that may arise when assembling.
parse
Functions for parsing an instruction string.

Macros§

encode_b_imm
Encode and integer as a bitmask for a B-type immediate.
encode_func3
Encode an integer as a bitmask for func3.
encode_func7
Encode an integer as a bitmask for func7.
encode_i_imm
Encode and integer as a bitmask for an I-type immediate.
encode_j_imm
Encode and integer as a bitmask for a J-type immediate.
encode_opcode
Encode an integer as a bitmask for the opcode.
encode_rd
Encode a register number as a bitmask for rd.
encode_rs1
Encode a register number as a bitmask for rs1.
encode_rs2
Encode a register number as a bitmask for rs2.
encode_s_imm
Encode and integer as a bitmask for an S-type immediate.
encode_u_imm
Encode and integer as a bitmask for a U-type immediate.
match_func3
Match an operation to the correct func3.
match_func7
Match an operation to the correct func7.
tokenize
Convert an instruction to it’s tokens, stripping out whitespace, parenthesis, and commas.

Functions§

assemble_ir
Assemble a single instruction.
assemble_program
Assemble a full program of newline-separated instructions.
assemble_program_buf
Assemble a BufRead down to a vector of words. The input should contain the entire program.