RISCVAssembler

class Object
trait Matchable
class Any

Value members

Concrete methods

def binOutput(input: String, width: Int): String

Generate the binary output for the input instruction

Generate the binary output for the input instruction

Value Params
input

the input instruction (eg. add x1, x2, x3)

Returns

the binary output in string format

def fromFile(filename: String): String

Generate an hex string output fom the assembly source file

Generate an hex string output fom the assembly source file

Usage:

val outputHex = RISCVAssembler.fromFile("input.asm")
Value Params
fileName

the assembly source file

Returns

the output hex string

def fromString(input: String): String

Generate an hex string output fom the assembly string

Generate an hex string output fom the assembly string

Usage:

val input =
     """
     addi x1 , x0,   1000
     addi x2 , x1,   2000
     addi x3 , x2,  -1000
     addi x4 , x3,  -2000
     addi x5 , x4,   1000
     """.stripMargin
   val outputHex = RISCVAssembler.fromString(input)
Value Params
input

input assembly string to assemble (multiline string)

Returns

the assembled hex string