Implemented compilation to SSA form
All checks were successful
/ test (push) Successful in 31s

This commit is contained in:
Eduard Urbach 2025-06-23 00:17:05 +02:00
parent f7be86a3d9
commit 31c5ed614c
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
27 changed files with 548 additions and 61 deletions

11
src/cpu/Register.go Normal file
View file

@ -0,0 +1,11 @@
package cpu
import "fmt"
// Register represents the number of the register.
type Register uint8
// String returns the human readable name of the register.
func (r Register) String() string {
return fmt.Sprintf("r%d", r)
}

13
src/cpu/Register_test.go Normal file
View file

@ -0,0 +1,13 @@
package cpu_test
import (
"testing"
"git.urbach.dev/cli/q/src/cpu"
"git.urbach.dev/go/assert"
)
func TestRegisterString(t *testing.T) {
register := cpu.Register(1)
assert.Equal(t, "r1", register.String())
}