generate the instruction table

This commit is contained in:
Michael McLoughlin
2018-11-24 13:47:30 -08:00
parent f1e1da6387
commit 70dcf2b611
8 changed files with 25542 additions and 11 deletions

View File

@@ -10,18 +10,21 @@ import (
)
type asmtest struct {
cfg Config
sym string // reference to the test function symbol
rel8 string // label to be used for near jumps
rel32 string // label for far jumps
}
func NewAsmTest() Interface {
return &asmtest{}
func NewAsmTest(cfg Config) Interface {
return &asmtest{cfg: cfg}
}
func (a *asmtest) Generate(is []*inst.Instruction) ([]byte, error) {
p := &printer{}
p.Printf("# %s\n\n", a.cfg.GeneratedWarning())
a.sym = "\u00b7loadertest(SB)"
p.Printf("TEXT %s, 0, $0\n", a.sym)