Documentation ¶
Overview ¶
Package m68k provides an emulator of the Motorola 68000 microprocessor.
Index ¶
- Constants
- type Int
- func (i Int) Add(v Int) Int
- func (i Int) Byte() byte
- func (i Int) IsNegative() bool
- func (i Int) Long() uint32
- func (i Int) SignBit() uint32
- func (i Int) SignExtend(sz int) Int
- func (i Int) SignedLong() int32
- func (i Int) Size() int
- func (i Int) Status() uint32
- func (i Int) Sub(v Int) Int
- func (i Int) Word() uint16
- type Processor
- type RunState
- type TrapHandler
- type TrapHandlerFunc
Constants ¶
const ( SizeByte = iota SizeWord SizeLong )
const ( StatusCarry = uint32(1) << iota // C StatusOverflow // V StatusZero // Z StatusNegative // N StatusExtend // X StatusMask = 0xA71F // Section 1.3.2 )
Status Register bits. See section 1.1.4.
const ( CondTrue = iota CondFalse CondHigh CondLowOrSame CondCarryClear CondCarrySet CondNotEqual CondEqual CondOverflowClean CondOverflowSet CondPlus CondMinus CondGreaterOrEqual CondLessThan CondGreaterThan CondLessOrEqual )
Comparison conditions. See table 3-19.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int represents the M68000 internal encoding of an integer and provides methods for emulating the its arithmetic behaviors.
func (Int) Add ¶
Add returns the sum of two integers and sets its status code to enable overflow and carry detection, etc. The number of bits mutated is limited by the width of the operand. For example, if a Byte is added to a Word, only the eight least significant bits will be modified by the function. The first 24 bit of the result will equal the first 24 of the Int.
func (Int) IsNegative ¶
IsNegative returns true if the sign it is set for the integer.
func (Int) SignExtend ¶
SignExtend returns an Int extended to the given size using signed arithmetic.
func (Int) SignedLong ¶
SignedLong returns all 32 bits of the integer as an int32.
type Processor ¶
type Processor struct { D [8]uint32 // Data registers A [8]uint32 // Address registers SR uint32 // Status Register PC uint32 // Program Counter M *m68kmem.Decoder // System memory controller // TraceWriter specifies where trace log output should be written to. If // TraceWriter is nil, no logging is performed. TraceWriter io.Writer // contains filtered or unexported fields }
A Processor emulates the Motorola 68000 microprocessor.
func (*Processor) RegisterTrapHandler ¶
func (c *Processor) RegisterTrapHandler(vector int, f TrapHandler) error
func (*Processor) Run ¶
Run executes any program loaded into memory, starting from the program counter value, running until completion.
type TrapHandler ¶
type TrapHandlerFunc ¶
func (TrapHandlerFunc) HandleTrap ¶
func (f TrapHandlerFunc) HandleTrap(p *Processor, v int) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package dump contains functions for printing the internal state of a Motorola 68000 processor emulator for debug purposes.
|
Package dump contains functions for printing the internal state of a Motorola 68000 processor emulator for debug purposes. |
Package m68ktest provides functions for testing Go code against the Motorola 68000 chipset emulator.
|
Package m68ktest provides functions for testing Go code against the Motorola 68000 chipset emulator. |
Package sim provides a simple simulator for interacting with the Motorola 68000 emulator package.
|
Package sim provides a simple simulator for interacting with the Motorola 68000 emulator package. |
Package srec provides decoding of the Motorola S-Record file format.
|
Package srec provides decoding of the Motorola S-Record file format. |