bit

package
v0.0.0-...-9ddd1ca Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckedAdd

func CheckedAdd(a, b uint8) (result uint8, overflow bool)

CheckedAdd adds two 8 bit unsigned values and detects if an overflow happened.

func CheckedSub

func CheckedSub(a, b uint8) (result uint8, borrow bool)

CheckedSub subtracts two 8 bit unsigned values and detects if a borrow happened.

func Clear

func Clear(index, byte uint8) uint8

Clear will return the passed byte with the bit at the specified index Set to 0.

func Combine

func Combine(high, low uint8) uint16

Combine combines two 8 bit values into a single 16 bit value. The high byte will be the most significant one.

func GetBitValue

func GetBitValue(index, byte uint8) uint8

GetBitValue returns a byte set to the value of the bit at the specified index.

func High

func High(value uint16) uint8

Low returns the higg (MSB) part of a 16 bit number.

func IsSet

func IsSet(index, byte uint8) bool

IsSet will check if the bit at the specified index is Set to 1 or not.

func Low

func Low(value uint16) uint8

Low returns the low (LSB) part of a 16 bit number.

func Reset

func Reset(index, byte uint8) uint8

Reset will return the passed byte with the bit at the specified index Set to 0.

func Set

func Set(index, byte uint8) uint8

Set will return the passed byte with the bit at the specified index Set to 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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