#pragma once #include #include // Machine geometry the tools use unless something says otherwise: how wide a // cell is in bits, and how many cells the tape holds. The instruction set does // not fix either (ROR just rotates inside a cell and the tape is a ring), so // these are the only places the old 8 bit / 256 cell assumptions live. inline constexpr size_t kDefaultCellSize = R8FORGE_CELL_SIZE; // build option: -DR8FORGE_CELL_SIZE=<1..32> inline constexpr size_t kDefaultMemoryCells = 259; // The VMs store a cell in uint32_t, so 32 bits is the ceiling -- and `1u << 32` // would be undefined, hence the special case instead of a plain shift. inline constexpr uint32_t kDefaultCellMask = kDefaultCellSize >= 32 ? 0xFFFFFFFFu : (1u << kDefaultCellSize) - 1u;