23 lines
338 B
Go
23 lines
338 B
Go
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()
|
|
}
|