wip
This commit is contained in:
10
printer.go
10
printer.go
@@ -70,7 +70,7 @@ func (p *GoPrinter) function(f *Function) {
|
||||
p.printf("TEXT %s%s(SB),0,$%d-%d\n", dot, f.Name(), f.FrameBytes(), f.ArgumentBytes())
|
||||
|
||||
for _, i := range f.inst {
|
||||
p.printf("\t%s\t%s\n", i.Mnemonic, strings.Join(i.Operands, ", "))
|
||||
p.printf("\t%s\t%s\n", i.Mnemonic, joinOperands(i.Operands))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,3 +83,11 @@ func (p *GoPrinter) printf(format string, args ...interface{}) {
|
||||
p.err = err
|
||||
}
|
||||
}
|
||||
|
||||
func joinOperands(operands []Operand) string {
|
||||
asm := make([]string, len(operands))
|
||||
for i, op := range operands {
|
||||
asm[i] = op.Asm()
|
||||
}
|
||||
return strings.Join(asm, ", ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user