srec

package
v0.0.0-...-3598644 Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package srec provides decoding of the Motorola S-Record file format.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidChecksum = errors.New("checksum validation failed")
)

Functions

func Load

func Load(m m68kmem.Memory, records []*Record) error

Load copies all data from the given slice of records into a 68000 memory bank.

Types

type Record

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

A Record is a single record from a Motorola 68000 S-Record encoded file. This format is used to share 68000 programs in plain text and is detailed in Appendix C of the M68000 Family Programmer's Reference Manual.

func Parse

func Parse(b []byte) (*Record, error)

Parse decodes the given byte array into a Record struct. The input is expected to be a heximdecimal encoded record with the 'S' prefix.

func Read

func Read(r io.Reader) ([]*Record, error)

Read reads and parses S-Records from the given Reader. Records are delimited by line breaks.

func (*Record) Address

func (s *Record) Address() int

Address specifies the destination memory address where data will be loaded for a data record.

func (*Record) Checksum

func (s *Record) Checksum() byte

Checksum returns the checksum byte for the Record.

func (*Record) Data

func (s *Record) Data() []byte

Data return the raw data section of the Record.

func (*Record) IsData

func (s *Record) IsData() bool

IsData returns true if the Record contains code or data.

func (*Record) String

func (s *Record) String() string

String returns a string represenation of the Record.

func (*Record) Type

func (s *Record) Type() string

Type returns the type of the Record. E.g. "S1".

Jump to

Keyboard shortcuts

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