summaryrefslogtreecommitdiff
path: root/vendor/github.com/chenzhuoyu/iasm/x86_64/pools.go
blob: 8e6cbbd8a8e7018fb3346d3af88e3adf9cb2241e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package x86_64

// CreateLabel creates a new Label, it may allocate a new one or grab one from a pool.
func CreateLabel(name string) *Label {
	p := new(Label)

	/* initialize the label */
	p.refs = 1
	p.Name = name
	return p
}

func newProgram(arch *Arch) *Program {
	p := new(Program)

	/* initialize the program */
	p.arch = arch
	return p
}

func newInstruction(name string, argc int, argv Operands) *Instruction {
	p := new(Instruction)

	/* initialize the instruction */
	p.name = name
	p.argc = argc
	p.argv = argv
	return p
}

// CreateMemoryOperand creates a new MemoryOperand, it may allocate a new one or grab one from a pool.
func CreateMemoryOperand() *MemoryOperand {
	p := new(MemoryOperand)

	/* initialize the memory operand */
	p.refs = 1
	return p
}