memory

package
v0.0.0-...-b5de531 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 14 Imported by: 5

Documentation

Index

Constants

View Source
const (
	UnpackedDecTSC = 0
	UnpackedDecLSC = 1
	UnpackedDecTS  = 2
	UnpackedDecLS  = 3 // <sign><zeroes><int>
	UnpackedDecU   = 4 // <zeroes><int>
	PackedDec      = 5
	TwosCompDec    = 6
	FPDec          = 7
)

Decimal Data Types - values are significant

View Source
const (
	NspLoc  = 040 // 32. Narrow Stack Pointer
	NfpLoc  = 041
	NslLoc  = 042
	NsfaLoc = 043
)

Some Page Zero special locations for the Narrow Stack

Variables

This section is empty.

Functions

func AddUnsharedPage

func AddUnsharedPage() int

AddUnsharedPage appends an unshared page to virtual memory

func BmcdchReadReg

func BmcdchReadReg(reg int) dg.WordT

BmcdchReadReg returns the single word contents of the requested register

func BmcdchReadSlot

func BmcdchReadSlot(slot int) dg.DwordT

BmcdchReadSlot returns the doubleword contents of the requested SLOT

func BmcdchReset

func BmcdchReset()

BmcdchReset clears bits 3,4,7,8 & 14 of the IOCDR

func BmcdchWriteReg

func BmcdchWriteReg(reg int, data dg.WordT)

BmcdchWriteReg populates a given 16-bit register with the supplied data N.B. Addressed by REGISTER not slot

func BmcdchWriteSlot

func BmcdchWriteSlot(slot int, data dg.DwordT)

BmcdchWriteSlot populates a whole SLOT (pair of registers) with the supplied doubleword N.B. Addressed by SLOT not register

func BoolToInt

func BoolToInt(b bool) int

BoolToInt converts a bool to 1 or 0

func BoolToOZ

func BoolToOZ(b bool) byte

BoolToOZ converts a boolean to a O(ne) or Z(ero) byte

func BoolToOnOff

func BoolToOnOff(b bool) string

BoolToOnOff converts a bool to "On" or "Off"

func BoolToYN

func BoolToYN(b bool) byte

BoolToYN converts a bool to Y or N

func ClearDwbit

func ClearDwbit(dword *dg.DwordT, bitNum uint)

ClearDwbit clears a single bit in a DG doubleword

func ClearQwbit

func ClearQwbit(qword *dg.QwordT, bitNum uint)

ClearQwbit clears a single bit in a DG quadword

func ClearWbit

func ClearWbit(word *dg.WordT, bitNum uint)

ClearWbit clears a single bit in a DG word

func DGdoubleToFloat64

func DGdoubleToFloat64(q dg.QwordT) (f float64)

DGdoubleToFloat64 converts a DG Double Precison number to Go float64

func DGsingleToFloat64

func DGsingleToFloat64(s dg.DwordT) (f float64)

DGsingleToFloat64 converts a DG Single Precison number to Go float64

func DecIntToInt

func DecIntToInt(decType int, dec string) (i int)

DecIntToInt returns an int value of the DG Decimal integer supplied

func DecodeDecDataType

func DecodeDecDataType(dti dg.DwordT) (scaleFactor int8, decType int, size int)

DecodeDecDataType extracts the scale, type and length from a Decimal Type Indicator

func DumpToFile

func DumpToFile(fn string) bool

DumpToFile writes out usefully greppable text representation of memory.

func DwordFromTwoWords

func DwordFromTwoWords(hw dg.WordT, lw dg.WordT) dg.DwordT

DwordFromTwoWords - catenate two DG Words into a DG DoubleWord

func DwordGetLowerWord

func DwordGetLowerWord(dwd dg.DwordT) dg.WordT

DwordGetLowerWord gets the DG-lower word (RHS) of a doubleword Called VERY often, hopefully inlined!

func DwordGetUpperWord

func DwordGetUpperWord(dwd dg.DwordT) dg.WordT

DwordGetUpperWord gets the DG-higher word (LHS) of a doubleword Called VERY often, hopefully inlined!

func FlipWbit

func FlipWbit(word *dg.WordT, bitNum uint)

FlipWbit - flips a single bit in a Word using DG numbering

func Float64toDGdouble

func Float64toDGdouble(f float64) (q dg.QwordT)

Float64toDGdouble converts a standard Go float64 into the DG Double Precision format

func Float64toDGsingle

func Float64toDGsingle(f float64) (s dg.DwordT)

Float64toDGsingle converts a standard Go float64 into the DG Single Precision format

func GetDwbits

func GetDwbits(value dg.DwordT, leftBit uint, nbits uint) dg.DwordT

GetDwbits - in the DG world, the first (leftmost) bit is numbered zero... extract nbits from value starting at leftBit

func GetFirstSharedPage

func GetFirstSharedPage() dg.DwordT

GetFirstSharedPage is a getter for the lowest shared page currently mapped

func GetLastSharedPage

func GetLastSharedPage() dg.DwordT

GetLastSharedPage calculates the last shared page mapped

func GetLastUnsharedPage

func GetLastUnsharedPage() dg.DwordT

GetLastUnsharedPage is a getter for the highest unshared page currently mapped

func GetNumSharedPages

func GetNumSharedPages() int

GetNumSharedPages is a getter for the number of shared pages currently mapped

func GetQwbits

func GetQwbits(value dg.QwordT, leftBit uint, nbits uint) dg.QwordT

GetQwbits - in the DG world, the first (leftmost) bit is numbered zero... extract nbits from value starting at leftBit

func GetSegment

func GetSegment(addr dg.PhysAddrT) int

GetSegment - return the segment number for the supplied address

func GetWbits

func GetWbits(value dg.WordT, leftBit uint, nbits uint) dg.WordT

GetWbits - in the DG world, the first (leftmost) bit is numbered zero... extract nbits from value starting at leftBit

func IsPageMapped

func IsPageMapped(page int) (locked bool)

func LoadFromASCIIFile

func LoadFromASCIIFile(asciiOctalFilename string) string

LoadFromASCIIFile reads a CSV-formatted ASCII file representing the contents of memory in octal words and loads it directly into memory. It can be used to directly load assembled listings such as diagnostics.

func MapPage

func MapPage(page int, shared bool)

MapPage maps (allocates) a 1kW page of virtual memory for the process

func MapSlice

func MapSlice(addr dg.PhysAddrT, wds []dg.WordT, shared bool)

MapSlice maps (copies) the provided slice to virtual memory starting at the given address

func MemInit

func MemInit(wordSize int, doLog bool)

MemInit should be called at machine start

func NsPop

func NsPop(seg dg.PhysAddrT, debugging bool) dg.WordT

NsPop - POP a word off the Narrow Stack

func NsPush

func NsPush(seg dg.PhysAddrT, data dg.WordT, debugging bool)

NsPush - PUSH a word onto the Narrow Stack

func QwordFromTwoDwords

func QwordFromTwoDwords(hdw dg.DwordT, ldw dg.DwordT) dg.QwordT

QwordFromTwoDwords - catenate two DG DoubleWords into a DG QuadWord

func QwordGetLowerDword

func QwordGetLowerDword(qwd dg.QwordT) dg.DwordT

QwordGetLowerDword gets the DG-lower (RHS) of a quadword

func QwordGetUpperDword

func QwordGetUpperDword(qwd dg.QwordT) dg.DwordT

QwordGetUpperDword gets the DG-upper (LHS) of a quadword

func ReadByte

func ReadByte(wordAddr dg.PhysAddrT, loByte bool) dg.ByteT

ReadByte - read a byte from memory using word address and low-byte flag (true => lower (rightmost) byte)

func ReadByteEclipseBA

func ReadByteEclipseBA(pcAddr dg.PhysAddrT, byteAddr16 dg.WordT) dg.ByteT

ReadByteEclipseBA - read a byte - special version for Eclipse Byte-Addressing

func ReadBytes

func ReadBytes(ba32 dg.DwordT, pc dg.PhysAddrT, num int) (res []byte)

ReadBytes - read specified # of bytes from 32-bit BA into slice

func ReadDWord

func ReadDWord(addr dg.PhysAddrT) dg.DwordT

ReadDWord does what it says on the tin

func ReadDec

func ReadDec(ba dg.PhysAddrT, size int) (dec string)

ReadDec returns a string of the Decimal value pointed to by the given byte address

func ReadDwordTrap

func ReadDwordTrap(wordAddr dg.PhysAddrT) (dg.DwordT, bool)

ReadDwordTrap returns the doubleword at the given physical address

func ReadEclipseWordTrap

func ReadEclipseWordTrap(wordAddr dg.WordT) (dg.WordT, bool)

ReadEclipseWordTrap returns the DG Word at the specified 16-bit physical address

func ReadNBytes

func ReadNBytes(ba dg.PhysAddrT, n int) []byte

ReadNBytes loads n bytes into a slice which is returned - no ring-forcing is performed

func ReadWord

func ReadWord(wordAddr dg.PhysAddrT) dg.WordT

ReadWord returns the DG Word at the specified physical address

func ReadWord16

func ReadWord16(wordAddr dg.WordT) dg.WordT

ReadWord16 returns the DG Word at the specified physical address

func ReadWordBmcChan

func ReadWordBmcChan(addr *dg.PhysAddrT) dg.WordT

ReadWordBmcChan reads a word from memory over the virtual Burst Multiplex Channel addr is incremented after use

func ReadWordBmcChan16bit

func ReadWordBmcChan16bit(addr *dg.WordT) dg.WordT

ReadWordBmcChan16bit reads a word from memory over the virtual Burst Multiplex Channel for 16-bit devices

func ReadWordDchChan

func ReadWordDchChan(addr *dg.PhysAddrT) dg.WordT

ReadWordDchChan - reads a 16-bit word over the virtual DCH channel addr is incremented after use

func ReadWordTrap

func ReadWordTrap(wordAddr dg.PhysAddrT) (dg.WordT, bool)

ReadWordTrap returns the DG Word at the specified physical address

func SetDwbit

func SetDwbit(dw *dg.DwordT, bitNum uint)

SetDwbit - sets a bit in a Double-Word

func SetQwbit

func SetQwbit(qw *dg.QwordT, bitNum uint)

SetQwbit - sets a bit in a Quad-Word

func SetWbit

func SetWbit(word *dg.WordT, bitNum uint)

SetWbit sets a single bit in a DG word

func SexWordToDword

func SexWordToDword(wd dg.WordT) dg.DwordT

SexWordToDword - sign-extend a DG word to a DG DoubleWord

func SwapBytes

func SwapBytes(wd dg.WordT) (res dg.WordT)

SwapBytes - swap over the two bytes in a dg_word

func TestBbit

func TestBbit(b8 dg.ByteT, b int) bool

TestBbit - does byte b8 have bit b set?

func TestDwbit

func TestDwbit(dw dg.DwordT, b int) bool

TestDwbit - does dword dw have bit b set?

func TestQwbit

func TestQwbit(qw dg.QwordT, b int) bool

TestQwbit - does qword qw have bit b set?

func TestWbit

func TestWbit(w dg.WordT, b int) bool

TestWbit - does word w have bit b set?

func UnmapPage

func UnmapPage(page int, shared bool)

UnmapPage unmaps (deallocates) a 1kW page of virtual memory from the process

func WordToBinStr

func WordToBinStr(w dg.WordT) string

WordToBinStr - get a pretty-printable string of a word

func WordsFromBytes

func WordsFromBytes(ba []byte) (wa []dg.WordT)

WordsFromBytes converts a slice of (Go) bytes into a slice of DG Words

func WriteByte

func WriteByte(wordAddr dg.PhysAddrT, loByte bool, b dg.ByteT)

func WriteByteBA

func WriteByteBA(byteAddr dg.DwordT, b dg.ByteT)

WriteByteBA writes a byte to a standard Byte Addressed location

func WriteBytesBA

func WriteBytesBA(b []byte, byteAddr dg.DwordT)

WriteBytesBA copies a byte array to the specified address

func WriteDWord

func WriteDWord(wordAddr dg.PhysAddrT, dwd dg.DwordT)

WriteDWord writes a doubleword into memory at the given physical address

func WriteStringBA

func WriteStringBA(s string, byteAddr dg.DwordT)

WriteStringBA copies a string to the specified address

func WriteWord

func WriteWord(wordAddr dg.PhysAddrT, datum dg.WordT)

WriteWord - For the 32-bit emulator ALL memory-writing should ultimately go through this function N.B. minor exceptions may be made for NsPush() and NsPop()

func WriteWord16

func WriteWord16(wordAddr dg.WordT, datum dg.WordT)

WriteWord16 - For the 16-bit emulators ALL memory-writing should ultimately go through this function N.B. minor exceptions may be made for NsPush() and NsPop()

func WriteWordBmcChan

func WriteWordBmcChan(addr *dg.PhysAddrT, data dg.WordT)

WriteWordBmcChan writes a word over the virtual Burst Multiplex Channel

func WriteWordBmcChan16bit

func WriteWordBmcChan16bit(addr *dg.WordT, data dg.WordT)

WriteWordBmcChan16bit writes a word over the virtual Burst Multiplex Channel for 16-bit devices

func WriteWordDchChan

func WriteWordDchChan(unmappedAddr *dg.PhysAddrT, data dg.WordT) (physAddr dg.PhysAddrT)

WriteWordDchChan writes a word to memory over the virtual DCH physAddr is returned for debugging purposes only

Types

This section is empty.

Jump to

Keyboard shortcuts

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