Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

VirtualMachine

Guides

  • Virtual Machine Package

Symbols

  • VirtualMachineAdd
  • VirtualMachineDefinition
  • VirtualMachineExecute
  • VirtualMachineList
  • VirtualMachine
  • VirtualMachineObject
  • VirtualMachineObjectQ
  • $VirtualMachines

Other

  • Intel4004
  • MOS6502
  • NFA
  • PDP1
  • PDP8
  • RegisterMachine
"PDP-8"
​
"PDP-8" an emulator of DEC's PDP-8 computer.
​
▪
Creating a virtual machine instance:
VirtualMachine
["PDP-8"]
create a new instance of the PDP-8 virtual machine
▪
For the
"PDP-8"
virtual machine, the following properties can be queried:
obj["MemoryDataset"]
a
Dataset
representating the memory pages
obj["MemoryState"]
an
SparseArray
representing the state of the memory
obj["MemoryView"]
a
MenuView
representing the memory pages
obj["ScreenState"]
an
Association
representing the state of the processor
obj["StepCount"]
the number of steps the machine has been run
▪
For the
"PDP-8"
virtual machine, the following commands can be executed using
VirtualMachineExecute
:
VirtualMachineExecute
[obj,"Debugger"]
return an interactive debugger
VirtualMachineExecute
[obj,"FrontPanel"]
return an interactive PDP-8 front panel
VirtualMachineExecute
[obj,"MemoryLoad",bin]
load a list of integers
bin
into memory
VirtualMachineExecute
[obj,"MemoryRead",addr]
read the contents of the memory address
addr
VirtualMachineExecute
[obj,"MemoryWrite",addr,val]
write
val
into the contents of the memory address
addr
VirtualMachineExecute
[obj,"ProcessorReset",org]
reset the state of the processor, setting the program counter to
org
VirtualMachineExecute
[obj,"Reset",bin,org]
reset the machine, loads
bin
into memory, and sets the program counter to
org
VirtualMachineExecute
[obj,"Run",n]
run
n
steps of the machine
VirtualMachineExecute
[obj,"RunTrace",n]
run
n
steps of the machine and return a trace of the evaluation
Examples
MoreExamples⊳
Create a new instance of the
"PDP-8"
virtual machine:
In[1]:=
pdp8=
VirtualMachine
["PDP-8"]
Out[1]=
VirtualMachineObject
Machine: PDP-8
StepCount: 0
InstructionRegister: AND
(0000)
ProgramCounter: 0000

Get information about the object:
In[2]:=
Information[pdp8]
Out[2]=
VirtualMachineObject
Machine Name
PDP-8
Properties
{Machine,MemoryDataset,MemoryState,MemoryView,ProcessorState,StepCount}
Commands
{Debugger,FrontPanel,ManualOperate,MemoryLoad,MemoryRead,MemoryReset,MemoryWrite,ProcessorReset,Reset,Run,RunTrace}
Functions
{Information,Normal}
Obtain the state of the processor:
In[3]:=
pdp8["ProcessorState"]//Dataset
Out[3]=
InstructionRegister
0
ProgramCounter
0
Accumulator
0
Link
0
InterruptEnabled
False
MemoryAddressRegister
0
MemoryBufferRegister
0
Load a program that fills the machine's memory with the value 8^^3333:
In[4]:=
VirtualMachineExecute
[pdp8,"MemoryLoad",{519,1798,1030,2560,3842,0,8,8^^3333}]
Out[4]=
VirtualMachineObject
Machine: PDP-8
StepCount: 0
InstructionRegister: AND
(0000)
ProgramCounter: 0000

Run the machine until it executes the halt instruction:
In[5]:=
VirtualMachineExecute
[pdp8,"Run",Infinity]
Out[5]=
VirtualMachineObject
Machine: PDP-8
StepCount: 16352
InstructionRegister: OPR
(7402)
ProgramCounter: 0005

Obtain the state of the processor after the machine has halted:
In[6]:=
pdp8["ProcessorState"]//Dataset
Out[6]=
InstructionRegister
3842
ProgramCounter
5
Accumulator
0
Link
0
InterruptEnabled
False
MemoryAddressRegister
2
MemoryBufferRegister
4
In[7]:=
pdp8["MemoryView"]
Out[7]=
Basic Examples
Interactive Examples
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com