lib

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

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompactOpcodes

func CompactOpcodes(file string)

func Process

func Process(assembly []string, goCompanionFile string) ([]string, error)

func ReadLines

func ReadLines(path string) ([]string, error)

ReadLines reads a whole file into memory and returns a slice of its lines.

func StripGoasmComments

func StripGoasmComments(file string)

func WriteLines

func WriteLines(lines []string, path string, header bool) error

WriteLines writes the lines to the given file.

Types

type Const

type Const struct {
	// contains filtered or unexported fields
}

type Epilogue

type Epilogue struct {
	Pops         []string // list of registers that are popped of the stack
	SetRbpInstr  bool     // is there an instruction to set Rbp in epilogue?
	StackSize    uint     // the size of the C stack
	AlignedStack bool     // is this an aligned stack?
	AlignValue   uint     // alignment value in case of an aligned stack
	VZeroUpper   bool     // is there a vzeroupper instruction in the epilogue?
	Start, End   int      // start and ending lines of epilogue
	// contains filtered or unexported fields
}

type Global

type Global struct {
	// contains filtered or unexported fields
}

type Label

type Label struct {
	Name   string
	Offset uint
}

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack(epilogue Epilogue, arguments int, stackSpaceForCalls uint) Stack

func (Stack) GolangLocalStackFrameSize

func (s Stack) GolangLocalStackFrameSize() uint

Get total local stack frame size (for Go) used in TEXT definition

func (Stack) OffsetForGoArg

func (s Stack) OffsetForGoArg(iarg int) uint

Get offset (from C Stack Pointer) for copy of Golang arguments 7 and higher

func (Stack) OffsetForSavedSP

func (s Stack) OffsetForSavedSP() uint

Get offset (from C Stack Pointer) for saving original Golang Stack Pointer

func (Stack) StackPointerOffsetForC

func (s Stack) StackPointerOffsetForC() uint

Get offset to adjust Stack Pointer appropriately for C code

type StackArgs

type StackArgs struct {
	Number        int
	OffsetToFirst int
}

type Subroutine

type Subroutine struct {
	// contains filtered or unexported fields
}

type Table

type Table struct {
	Name      string
	Constants string
	Labels    []Label
}

Jump to

Keyboard shortcuts

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