{"type": "session", "harness": "opencode", "id": "asm-riscv", "name": "RISC-V Assembly Architecture"} {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}} {"type": "message", "message": {"role": "user", "content": "Explain RISC-V assembly architecture"}} {"type": "message", "message": {"role": "assistant", "content": "RISC-V: open-source ISA. RV32I (32-bit), RV64I (64-bit), RV128I.\n\nRegisters: x0-x31 (ABI names: zero, ra, sp, gp, tp, t0-t6, s0-s11, a0-a7). x0 hardwired to zero.\n\nFixed-width 32-bit instructions. R-type (register), I-type (immediate), S-type (store), B-type (branch), U-type (upper immediate), J-type (jump).\n\nInstructions: ADD/SUB, AND/OR/XOR, SLL/SRL/SRA, LW/LH/LB/SW/SH/SB, BEQ/BNE/BLT/BGE, JAL/JALR, LUI/AUIPC.\n\nM extension: MUL/MULH/MULHSU/MULHU/DIV/DIVU/REM/REMU. F/D extensions: floating point.\n\nPrivilege levels: M (machine), S (supervisor), U (user). CSR instructions: CSRR/CSRW/CSRS."}}