SimpleRISC Assembler

Assembly Code

Machine Code

Implementation Details

About SimpleRISC

SimpleRISC is a simplified RISC (Reduced Instruction Set Computer) architecture designed for educational purposes. This web-based assembler translates SimpleRISC assembly language into machine code.

Assembler Features

  • Two-pass assembly process for handling labels and symbol resolution
  • Support for all SimpleRISC instructions including arithmetic, logical, and control flow operations
  • Register and immediate addressing modes
  • 32-bit instruction encoding format

Instruction Format

SimpleRISC uses a 32-bit instruction word with the following general format:

  • Bits 27-31: 5-bit opcode field
  • Bit 26: Mode bit (0 for register operands, 1 for immediate operands)
  • Bits 21-25: First register operand (rd)
  • Bits 16-20: Second register operand (rs1)
  • Bits 11-15: Third register operand (rs2) or part of immediate value
  • Bits 0-10: Extended immediate field or unused

Supported Instructions

Type Instructions Format
Arithmetic & Logic add, sub, mul, div, mod, and, or, not, lsl, lsr, asr op rd, rs1, rs2
op rd, rs1, #imm
Data Movement mov, ld, st mov rd, rs1
mov rd, #imm
ld/st rd, rs1, rs2
ld/st rd, rs1, #imm
Control Flow b, beq, bgt, call, ret b label
beq label
bgt label
call label
ret
Other cmp, nop cmp rd, rs1
cmp rd, #imm
nop