mem

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

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

Go to latest
Published: Jun 17, 2021 License: Unlicense Imports: 0 Imported by: 0

Documentation

Overview

Package mem implements memory devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressSpace

type AddressSpace map[uint16]uint16

AddressSpace maps 16-bit addresses to 16-bit values.

type RAM

type RAM struct {
	Mem           AddressSpace
	VGAOffset     uint16
	VGAWidth      int
	VGAHeight     int
	StackMin      uint16
	StackMax      uint16
	ProgramOffset uint16
	HeapOffset    uint16
}

RAM represents 128K of word-based memory (64K addresses).

func NewRAM

func NewRAM(a AddressSpace, vw int, vh int) *RAM

NewRAM returns a pointer to a newly initialized RAM.

func (*RAM) Get

func (m *RAM) Get(address uint16) uint16

Get gets the value stored at a specified address.

func (*RAM) Set

func (m *RAM) Set(address uint16, value uint16)

Set sets the specified address to the specified value.

Jump to

Keyboard shortcuts

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