Implemented instruction lists
This commit is contained in:
parent
315d2d075e
commit
d5f752bdd4
12 changed files with 165 additions and 23 deletions
23
src/asm/Base.go
Normal file
23
src/asm/Base.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package asm
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/asm/x64"
|
||||
)
|
||||
|
||||
// Base represents the data that is common among all instructions.
|
||||
type Base struct {
|
||||
Mnemonic Mnemonic
|
||||
}
|
||||
|
||||
func (x *Base) Write(w io.ByteWriter) {
|
||||
switch x.Mnemonic {
|
||||
case SYSCALL:
|
||||
x64.Syscall(w)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Base) String() string {
|
||||
return x.Mnemonic.String()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue