xx/asm/asm.go

26 lines
330 B
Go

package asm
type Call struct {
registers
fn uintptr
sp uintptr
stack [128]uintptr
}
func PrepareCall(fn uintptr) Call {
return Call{fn: fn}
}
func (c *Call) Push(v uintptr) {
c.stack[c.sp] = v
c.sp += 1
}
func (c *Call) Pop() uintptr {
c.sp -= 1
return c.stack[c.sp]
}
func (c *Call) Do() {
perform_call(c)
}