ext

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

README

ext

Demonstrates how to use external types in an avo function signature.

In this case, you will need to write the function stub yourself.

package ext

import "github.com/mmcloughlin/avo/examples/ext/ext"

// StructFieldB returns field B.
func StructFieldB(e ext.Struct) byte

Then in place of the usual TEXT declaration we use Implement to state that we are beginning the definition of a function already declared in the package stub file.

	Package("github.com/mmcloughlin/avo/examples/ext")
	Implement("StructFieldB")
	b := Load(Param("e").Field("B"), GP8())
	Store(b, ReturnIndex(0))
	RET()

Finally, in this case the go:generate line is different since we do not need to generate the stub file.

//go:generate go run asm.go -out ext.s

Documentation

Overview

Package ext demonstrates how to interact with external types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructFieldB

func StructFieldB(e ext.Struct) byte

StructFieldB returns field B.

Types

This section is empty.

Directories

Path Synopsis
Package ext is used as a target package in the external types example.
Package ext is used as a target package in the external types example.

Jump to

Keyboard shortcuts

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