Package io.matita08.data


package io.matita08.data
Data management package for the CPU simulator.

This package provides comprehensive data storage and management functionality for the simulated CPU, including registers, memory, flags, and state tracking. All CPU state information is centralized in this package to ensure consistent access patterns and efficient GUI updates.

Core Components:

  • Registers - Complete CPU register file and memory management
  • Flags - CPU flags system for arithmetic/logic operation results
  • FlagsConstants - Enumeration of available CPU flags
  • ControlUnit - Control unit state and execution phase tracking

Key Features:

  • Comprehensive Register Management: PC, IR, MAR, MDR, Accumulator, and more
  • Central Memory System: Configurable memory array with Value-based storage
  • I/O Buffer Management: Input/output buffers for external communication
  • Modification Tracking: Efficient GUI update optimization through change flags
  • Thread Safety: Safe concurrent access to CPU state information
  • Flag System: CPU condition flags with bitmask operations

Register Architecture:

The register system implements a realistic CPU register file with:

  • Program Counter (PC): Address of next instruction to execute
  • Instruction Register (IR): Currently decoded instruction
  • Memory Address/Data Registers (MAR/MDR): Memory interface registers
  • General Purpose Registers: Accumulator and Register B for operations
  • Addressing Support: Pointer register for indirect addressing

Memory Management:

The central memory system provides:

  • Configurable memory size via Constants
  • Value-based storage supporting both defined and undefined states
  • Address validation and bounds checking
  • Efficient bulk operations for program loading

Modification Tracking:

The package implements an efficient change tracking system using bitmask flags:

  • Bit 0 (1): Central Memory modified
  • Bit 1 (2): CPU Registers modified
  • Bit 2 (4): ALU state modified
  • Bit 3 (8): I/O Buffers modified
Since:
1.0
  • Class
    Description
    CPU Control Unit State Management.
    CPU Flags Management System.
    Enumeration of CPU flag constants used in the simulator's flag management system.
    CPU Register and Memory Management System.