Simplified file structure

This commit is contained in:
2024-08-07 19:39:10 +02:00
parent 1b13539b22
commit 66569446b1
219 changed files with 453 additions and 457 deletions

25
src/asm/Register.go Normal file
View File

@ -0,0 +1,25 @@
package asm
import (
"git.akyoto.dev/cli/q/src/cpu"
)
// Register operates with a single register.
type Register struct {
Register cpu.Register
}
// String returns a human readable version.
func (data *Register) String() string {
return data.Register.String()
}
// Register adds an instruction using a single register.
func (a *Assembler) Register(mnemonic Mnemonic, register cpu.Register) {
a.Instructions = append(a.Instructions, Instruction{
Mnemonic: mnemonic,
Data: &Register{
Register: register,
},
})
}