Hello world!

A project log for risk-vee

An as-small-as-possible RISC-V implementation in Logisim.

Nicky NickellNicky Nickell 01/06/2017 at 05:290 Comments

There isn't a whole lot to say about it, but risk-vee now has a text console. It is located at the first I/O port (0xff000000) and has four registers: output, data available, input, and reset. Logisim can't handle bi-directional pins on subcircuits so for now the input register (data from the keyboard) isn't hooked up. I'll need to restructure the circuit a little bit to make it work, but I don't feel like playing with that right now.

My assembler isn't complete enough to handle it, but the hello world program looks like this:

lui 1, 0xff000000	// output port
addi 2, 0, 0x20		// string base
add 3, 0, 2		// index
lb 4, 3, 0		// get character
beq 4, 0, -8		// if 00, reset index
sb 1, 4, 0		// write character
addi 3, 3, 1		// increment index
beq 0, 0, -16 
.string "Hello world!"

As usual, not that exciting, but now we know load upper immediate (LUI) and the load/store instructions work properly. My next task will probably be making a table of the instructions risk-vee supports, their cycle length, and whether they have been tested or not.