stack

package
v0.0.0-...-2ded9d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

*

栈指令直接对操作数栈进行操作
pop和pop2指令将制定变量弹出
dup系列指令复制栈顶变量
swap指令交换栈顶的两个变量

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DUP

type DUP struct {
	base.NoOperandsInstruction
}

*

复制栈顶的单个变量

func (*DUP) Execute

func (self *DUP) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 1 栈顶
执行后
	栈底 1 1 栈顶

type DUP2

type DUP2 struct {
	base.NoOperandsInstruction
}

Duplicate the top one or two operand stack values

func (*DUP2) Execute

func (self *DUP2) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 2 1 栈顶
执行后
	栈底 2 1 2 1 栈顶

type DUP2_X1

type DUP2_X1 struct {
	base.NoOperandsInstruction
}

func (*DUP2_X1) Execute

func (self *DUP2_X1) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 3 2 1 栈顶
执行后
	栈底 2 1 3 2 1 栈顶

type DUP2_X2

type DUP2_X2 struct {
	base.NoOperandsInstruction
}

func (*DUP2_X2) Execute

func (self *DUP2_X2) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 4 3 2 1 栈顶
执行后
	栈底 2 1 4 3 2 1 栈顶

type DUP_X1

type DUP_X1 struct {
	base.NoOperandsInstruction
}

Duplicate the top operand stack value and insert two values down

func (*DUP_X1) Execute

func (self *DUP_X1) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 2 1 栈顶
执行后
	栈底 1 2 1 栈顶

type DUP_X2

type DUP_X2 struct {
	base.NoOperandsInstruction
}

Duplicate the top operand stack value and insert two or three values down

func (*DUP_X2) Execute

func (self *DUP_X2) Execute(frame *chapter4_rtdt.Frame)

*

执行前
	栈底 3 2 1 栈顶
执行后
	栈底 1 3 2 1 栈顶

type POP

type POP struct {
	base.NoOperandsInstruction
}

*

只能用于弹出int float等占用一个操作数栈未知的变量

func (*POP) Execute

func (self *POP) Execute(frame *chapter4_rtdt.Frame)

type POP2

type POP2 struct {
	base.NoOperandsInstruction
}

*

用于弹出double long变量

func (*POP2) Execute

func (self *POP2) Execute(frame *chapter4_rtdt.Frame)

type SWAP

type SWAP struct {
	base.NoOperandsInstruction
}

*

用于交换栈顶的两个变量

func (*SWAP) Execute

func (self *SWAP) Execute(frame *chapter4_rtdt.Frame)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL