Documentation ¶
Index ¶
- Variables
- func Asm(pc uint16, text string) (codes []uint16, err error)
- type ArrayMem
- type CPU
- func (cpu *CPU) Disasm(pc uint16) (asm string, next uint16, err error)
- func (cpu *CPU) ReadB(addr uint16) (uint8, error)
- func (cpu *CPU) ReadW(addr uint16) (uint16, error)
- func (cpu *CPU) Step(n int) (err error)
- func (cpu *CPU) WriteB(addr uint16, val uint8) error
- func (cpu *CPU) WriteW(addr uint16, val uint16) error
- type FPS
- type Memory
- type PS
- type RegNum
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ArrayMem ¶
type ArrayMem [1 << 16]byte
An ArrayMem is a Memory implementation backed by a 64kB array. All addresses are valid.
type CPU ¶
type CPU struct { R [8]uint16 // registers PS PS // processor status word Inst uint16 // instruction being executed (actual instruction bits) Mem Memory // attached memory F [6]float64 // floating-point registers FPS FPS // floating point status word FEC uint8 // fp error code FEA uint8 // fp exception address }
A CPU represents a single PDP-11 CPU, connected to a memory.
type FPS ¶
type FPS uint16
An FPS is the processor status word. Only the condition codes are used.
const ( FC FPS = 1 << iota // C = 1 if result generated carry FV // V = 1 if result overflowed FZ // Z =1 if result was zero FN // N = 1 if result was negative FT // truncate bit FL // long-precision integer mode FD // double-precision mode FIC // floating interrupt on integer conversion error (TODO) FIV // floating interrupt on overflow (TODO) FIU // floating interrupt on underflow (TODO) FIUV // floating interrupt on undefined variable (TODO) FID // floating interrupt disable (TODO) FER // floating error condiiton present (TODO) )
type Memory ¶
type Memory interface { ReadB(addr uint16) (uint8, error) ReadW(addr uint16) (uint16, error) WriteB(addr uint16, val uint8) error WriteW(addr uint16, val uint16) error }
A Memory represents a PDP-11 memory.
Click to show internal directories.
Click to hide internal directories.