central-arch/cmd/asmtest/asmtest.go

25 lines
652 B
Go

package main
import (
"fmt"
"git.elyanpoujol.fr/elyan/central-arch/pkg/cpu"
"git.elyanpoujol.fr/elyan/central-arch/pkg/instr"
"git.elyanpoujol.fr/elyan/central-arch/pkg/instrset"
"git.elyanpoujol.fr/elyan/central-arch/pkg/simcontext"
"git.elyanpoujol.fr/elyan/central-arch/pkg/siminstr"
)
const (
MOV_r1_r2 instr.Instr = 0xffff_ff2a
SVC_ffffff instr.Instr = 0xffff_ffff
)
func main() {
cpu := cpu.New(simcontext.SimContext{}, nil)
cpu.RegisterInstr(siminstr.SimInstrDesc{InstrDesc: &instrset.LDRIR, Behavior: nil})
fmt.Printf("MOV[6:0] = %#0x\n", cpu.GetOpCode(MOV_r1_r2))
fmt.Printf("SVC[6:0] = %#0x\n", cpu.GetOpCode(SVC_ffffff))
}