Example #1
0
func wrapMain(funcs []*PkgSym) *Func {
	ret := NewFunc() // the main func

	// clear r0 for safety
	ret.AddInst(inst.Reg(arch8.XOR, 0, 0, 0, 0, 0))

	for _, f := range funcs {
		ret.AddInst(inst.Jmp(arch8.JAL, 0))
		ret.AddLink(FillLink, f)
	}

	ret.AddInst(inst.Sys(arch8.HALT, 0))

	return ret
}
Example #2
0
func (_s) halt() uint32 { return S.Sys(A.HALT, 0) }
Example #3
0
func makeInstSys(op, reg uint32) *inst {
	return &inst{inst: asminst.Sys(op, reg)}
}