Interface CPU
- All Superinterfaces:
Plugin
- All Known Implementing Classes:
AbstractCPU
Should be implemented by a plugin. There should exist just one implementation.
CPU can define one or more "CPU contexts" (usually just one), which can extend the runtime functionality accessible to plugins.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionexecute()Runs the instruction loop synchronously until natural completion or cooperative interruption.intGet the number of addressable instruction locations exposed by this CPU.default List<DebuggerColumn<?>> getDebuggerColumns(Decoder instructions) Get custom columns of the debugger table.Get the instruction decoder.Get CPU status panel.default booleanDetermines if this plugin supports emulation automation.voidreset(int location) Resets the CPU synchronously after the host has acknowledged actual execution exit.booleansetInstructionLocation(int location) Set memory location of an instruction which will be emulated as next.step()Executes one instruction synchronously on the host's CPU worker and returns its result.Methods inherited from interface Plugin
destroy, getCopyright, getDescription, getDocumentationUrl, getTitle, getVersion, initialize, isShowSettingsSupported, reset, showSettings, startAutomation, stopAutomation
-
Method Details
-
step
Executes one instruction synchronously on the host's CPU worker and returns its result.- Throws:
Exception
-
execute
Runs the instruction loop synchronously until natural completion or cooperative interruption. The host supplies the worker thread, serializes CPU mutations, and publishes lifecycle events. Return STATE_RUNNING when interrupted without another terminal reason; the host applies the requested pause/stop state. Natural halt, breakpoint, and failures must retain their actual result.- Throws:
Exception
-
getStatusPanel
JPanel getStatusPanel()Get CPU status panel.Each CPU plugin must have a status panel that shows some important CPU status (e.g. registers, flags, run state, etc.) and allows to manage some settings (e.g. a runtime frequency, etc.).
This panel is located on the right side in the "emulation" panel of the main module.
CPU itself should take care about updating the panel when it is appropriate.
- Returns:
- CPU status panel
-
reset
void reset(int location) Resets the CPU synchronously after the host has acknowledged actual execution exit.- Parameters:
location- Program location in memory
-
setInstructionLocation
boolean setInstructionLocation(int location) Set memory location of an instruction which will be emulated as next.Instruction position is more "abstract" name for "program counter", which is mostly used in 8-bit architectures.
This method is called by emuStudio application when a user perform "jump to address" operation.
- Parameters:
location- new address of actual instruction- Returns:
- true if operation was successful, false otherwise
-
getAddressSpaceSize
int getAddressSpaceSize()Get the number of addressable instruction locations exposed by this CPU.- Returns:
- positive address-space size; the highest valid location is one less than this value
-
getDecoder
Decoder getDecoder()Get the instruction decoder.EmuStudio shares captured instruction facts across listing and flow analysis.
- Returns:
- decoder of CPU instructions
-
getDebuggerColumns
Get custom columns of the debugger table.- Parameters:
instructions- host-owned lookup of captured instruction rows; use this for instruction columns- Returns:
- debugger columns; empty list means default columns (address, mnemo, opcode)
-
isAutomationSupported
default boolean isAutomationSupported()Description copied from interface:PluginDetermines if this plugin supports emulation automation.- Specified by:
isAutomationSupportedin interfacePlugin- Returns:
- true if the plugin supports emulation automation; false otherwise
-