XL1200-EMU Symbolics XL1200 Emulator
Architecture & Guides docs/internal-registers.md

Ivory Internal & Coprocessor Registers

This document catalogs every architectural internal register accessed via READ-INTERNAL-REGISTER (#o154) and WRITE-INTERNAL-REGISTER (#o155), plus the Weitek W3164/W3364 Floating-Point Accelerator (FPA) and microsecond clock registers accessed via COPROCESSOR-READ (#o156) and COPROCESSOR-WRITE (#o157).

All register numbers, bitfields, and behaviors match emu/include/ivory_hw.h, emu/src/cpu.c, and emu/src/fpa_w3x64.c. For data-type encodings and the full Control/ALU register bit layouts, see Volume 1: CPU Data Types & Registers.

Primary Reference Sources (local-only when present):

  • genera-original/sys.sct/i-sys/sysdf1.lisp — Internal register numbers #o000..#o652 and #o1000..#o1077.
  • genera-original/sys.sct/i-sys/sysdef.lisp — Control Register (CR) and ALU & Rotate Control bitfields.
  • genera-original/sys.sct/i-compiler/i-sysdef-support.lisp — Compiler register map.
  • genera-original/sys.sct/i-sys/fpa.lisp — Weitek W3164/W3364 FPA coprocessor register map and status nibbles.

Read Invariant: READ-INTERNAL-REGISTER (#o154) always forces the returned word's CDR code to IVORY_CDR_NEXT (0), regardless of what CDR bits were previously stored.


1. External Bus & Processor State Registers (#o000..#o652)

Registers indexed by Block Address Register (BAR0..3) add (bar << 7) (+#o000, +#o200, +#o400, +#o600) to the base register number.

OctalEnum Constant (ivory_hw.h)AccessDescription
#o000IVORY_REG_EAR/WEffective Address register
#o001IVORY_REG_FPR/WFrame Pointer (DTP_LOCATIVE)
#o002IVORY_REG_LPR/WLocal Pointer (DTP_LOCATIVE)
#o003IVORY_REG_SPR/WStack Pointer (R: E.SP, W: D.SP, DTP_LOCATIVE)
#o004IVORY_REG_MACRO_SPRCommitted macroinstruction Stack Pointer (C.MACRO-SP)
#o005IVORY_REG_STACK_CACHE_LOWER_BOUNDR/WLowest VMA currently resident in the 128-word on-chip stack cache
#o006, #o206, #o406, #o606IVORY_REG_BAR_0..3R/WBlock Address Registers 0..3 (DTP_LOCATIVE or DTP_PHYSICAL_ADDRESS)
#o007, #o207, #o407, #o607IVORY_REG_PHT_HASH_0..3RHardware 26-bit PHT bucket offset (ivory_pht_hash(BARn))
#o010IVORY_REG_PCR/WProgram Counter (DTP_EVEN_PC / DTP_ODD_PC)
#o011IVORY_REG_D_PCRDecode-stage PC (D.PC)
#o012IVORY_REG_CONTINUATIONR/WSaved return PC / pending StartCall target
#o013IVORY_REG_ALU_AND_ROTATE_CONTROLR/W32-bit ALU operation, byte rotate/size (R/S), and condition register
#o014IVORY_REG_CONTROL_REGISTERR/W32-bit Control Register (CR: arg size, caller frame size, disposition, trace, trap mode)
#o015IVORY_REG_CR_ARGUMENT_SIZERLow 8 bits (<7:0>) of CR as DTP_FIXNUM
#o016IVORY_REG_EPHEMERAL_OLDSPACER/W32-bit bitmask of Zone 0 ephemeral half-levels in oldspace
#o017IVORY_REG_ZONE_OLDSPACER/W32-bit bitmask of Zones 0..31 in oldspace
#o020IVORY_REG_CHIP_REVISIONRIvory silicon revision (4 for XL1200 Rev 4 and Rev 4A)
#o021IVORY_REG_FP_COPROCESSOR_PRESENTR/WFloating-point coprocessor presence flag (1 = W3x64 FPA attached)
#o022IVORY_REG_MICROCODE_RETURN_ADDRESSRMicrocode return address (diagnostic)
#o023IVORY_REG_PREEMPT_REGISTERR/WPreempt / interrupt status (reflects Merlin-II pending sequence breaks)
#o024IVORY_REG_ICACHE_CONTROLR/WInstruction cache enable / flush control (writes flush emulator IvoryDcache & L0 cache)
#o025IVORY_REG_PREFETCHER_CONTROLR/WInstruction prefetcher control
#o026IVORY_REG_MAP_CACHE_CONTROLR/WMap Cache enable / flush control (writes invalidate Map Cache & bump map_epoch)
#o027IVORY_REG_MEMORY_CONTROLR/WMemory interface & ECC control
#o030IVORY_REG_ECC_LOGRECC syndrome log
#o031IVORY_REG_ECC_LOG_ADDRESSRFaulting address of last ECC event
#o032, #o232, #o432, #o632IVORY_REG_INVALIDATE_MAP_0..3WInvalidate Map Cache entry matching BAR0..3
#o033, #o233, #o433, #o633IVORY_REG_LOAD_MAP_0..3WLoad PHT1 word into Map Cache for BAR0..3
#o034IVORY_REG_STACK_CACHE_OVERFLOW_LIMITR/WSpill threshold for the 128-word stack cache
#o035IVORY_REG_UCODE_ROM_CONTENTSRMicrocode ROM inspection
#o036IVORY_REG_LOOP_COUNTERWHardware loop counter
#o037IVORY_REG_ADDRESS_MASKR/WRev 4+: Physical address mask register
#o040IVORY_REG_ENTRY_MAXIMUM_ARGUMENTSRCallee max_args latched from ENTRY instruction
#o041IVORY_REG_LEXICAL_VARIABLERCurrent lexical variable pointer
#o042IVORY_REG_INSTRUCTIONRCurrent instruction halfword
#o043IVORY_REG_IMMEDIATEWImmediate operand register
#o044IVORY_REG_MEMORY_DATARLast memory data word read
#o045IVORY_REG_DATA_PINSR/WExternal data pins (diagnostic)
#o046IVORY_REG_EXTENSION_REGISTERR/W32-bit extension register (used by double-word multiply/divide)
#o047IVORY_REG_MICROSECOND_CLOCKR/WRev 4+: Free-running 32-bit microsecond counter (1 µs per 4 instructions in deterministic mode)
#o050IVORY_REG_ARRAY_HEADER_LENGTHRFast array header length latch
#o052, #o252, #o452, #o652IVORY_REG_LOAD_MATCHING_MAP_0..3WUpdate Map Cache entry with PHT1 only if VPN matches BAR0..3

2. On-Chip Scratchpad Registers (#o1000..#o1077)

All 64 scratchpad locations are 40-bit R/W words (cpu->scratchpad[reg_no - 01000]). Architecturally assigned slots:

OctalEnum Constant (ivory_hw.h)Cold-Reset Value / Purpose
#o1000IVORY_REG_TOSTop-of-stack mirror (read/write accesses live stack TOS)
#o1001IVORY_REG_EVENT_COUNTMonotonic event counter
#o1002IVORY_REG_BINDING_STACK_POINTERCurrent dynamic binding stack top (DTP_LOCATIVE)
#o1003IVORY_REG_CATCH_BLOCK_LISTHead of active CATCH block chain
#o1004IVORY_REG_CONTROL_STACK_LIMITNormal control stack overflow threshold
#o1005IVORY_REG_CONTROL_STACK_EXTRA_LIMITExtra-stack overflow threshold (trap_mode == 1)
#o1006IVORY_REG_BINDING_STACK_LIMITDynamic binding stack overflow threshold
#o1007IVORY_REG_PHT_BASEWired VMA base of Page Hash Table
#o1010IVORY_REG_PHT_MASKPower-of-two PHT bucket bitmask
#o1011IVORY_REG_COUNT_MAP_RELOADSCount of Map Cache reloads from PHT
#o1012IVORY_REG_LIST_CACHE_AREAFast consing area for ALLOCATE-LIST-BLOCK
#o1013IVORY_REG_LIST_CACHE_ADDRESSCurrent consing pointer
#o1014IVORY_REG_LIST_CACHE_LENGTHRemaining words in list consing chunk
#o1015IVORY_REG_STRUCTURE_CACHE_AREAFast allocation area for ALLOCATE-STRUCTURE-BLOCK
#o1016IVORY_REG_STRUCTURE_CACHE_ADDRESSCurrent structure allocation pointer
#o1017IVORY_REG_STRUCTURE_CACHE_LENGTHRemaining words in structure allocation chunk
#o1020IVORY_REG_DYNAMIC_BINDING_CACHE_BASEBase of dynamic binding hash cache
#o1021IVORY_REG_DYNAMIC_BINDING_CACHE_MASKMask of dynamic binding hash cache
#o1022IVORY_REG_CHOICE_POINTERLogic-programming (Prolog) choice pointer
#o1023IVORY_REG_STRUCTURE_STACK_CHOICE_POINTERStructure-stack choice pointer
#o1024IVORY_REG_FEP_MODE_TRAP_VECTOR_ADDRESSTrap vector base used when CR.trap_mode == 3 (IVORY_TRAP_MODE_FEP)
#o1026IVORY_REG_MAPPING_TABLE_CACHEFlavors/CLOS instance mapping table cache pointer
#o1027IVORY_REG_MAPPING_TABLE_LENGTHMapping table cache length
#o1030IVORY_REG_STACK_FRAME_MAXIMUM_SIZEMaximum single frame size before FRAME_OVERFLOW
#o1031IVORY_REG_STACK_CACHE_DUMP_QUANTUMWords spilled per stack-cache overflow dump
#o1040IVORY_REG_CONSTANT_NILCold reset: (DTP_NIL, 0xF8041200) (IVORY_NIL_PMA)
#o1041IVORY_REG_CONSTANT_TCold reset: (DTP_SYMBOL, 0xF8041208) (IVORY_T_PMA)

(Note: Scratchpad slots #o1025, #o1032..#o1037, and #o1042..#o1077 are general software/FEP scratchpad storage.)


3. Coprocessor Registers (#o156 / #o157 — Weitek W3x64 FPA & Clock)

COPROCESSOR-READ (#o156) and COPROCESSOR-WRITE (#o157) take a 10-bit immediate register address targeting either the Weitek W3164/W3364 Floating-Point Accelerator (emu/src/fpa_w3x64.c) or the Rev 4 microsecond clock:

Data & Control Ports

OctalAccessPurpose
#o0000R/WR0_HI (single-float arg0 or double-float arg0 high word)
#o0001RR1_LO readback
#o0002W / RWrite: R0_LO (double arg0 low); Read: RES_HI (tagged DTP_SINGLE_FLOAT if !last_fpex, else DTP_FIXNUM)
#o0003W / RWrite: R1_LO (double arg1 low); Read: RES_LO (double result low word)
#o0200, #o0202R/WR2_HI, R2_LO auxiliary operand registers
#o0374WFIXNUM-MULTIPLY arg0 staging register
#o0400RRES_HI readback
#o0624W%FPA-RESET-ADDRESS — resets FPA pipeline, sticky flags, and rounding mode
#o1002R/WRev 4 microsecond_clock (identical counter to %REGISTER-MICROSECOND-CLOCK #o047)

FPA Status Registers (#o0600..#o0613, Value in Bits <31:24>)

OctalRegisterBit Layout (within byte <31:24>)
#o0600SR0 (Modes 0)<2:1>: IEEE-754 rounding (0=Nearest, 1=TowardZero, 2=Upward, 3=Downward); <6>: FPEX_STICKY (0x40)
#o0602SR2 (Trap Enables)<7> NAN (0x80), <6> INV (0x40), <5> DVZ (0x20), <4> DNRM (0x10), <3> OVF (0x08), <2> UNF (0x04), <1> INX (0x02), <0> IOVF (0x01)
#o0603SR3 (Sticky Flags)Same bit positions as SR2 (0x80..0x01)
#o0606SR6 (Unit Status)<7:4> Adder status nibble, <3:0> Multiplier status nibble (*W3X64-STATUS-CODES*)
#o0613SR11 (Divider / Exception)<7> FPEX_TAKEN (0x80), <6> DSR_IN_PROGRESS (0x40), <5> FPCN compare condition (0x20), <3:0> Divider status nibble

Writing R1_HI to an operation trigger address (opcode + 1) executes the IEEE-754 single/double add, subtract, multiply, divide, square-root, negate, absolute-value, compare, or integer conversion immediately and updates SR3/SR6/SR11 and last_fpex. Compare result reads (opcode + 2) return T or NIL (or DTP_FIXNUM 0 when last_fpex fired).


4. Merlin-II Motherboard & I/O Registers (External Physical Bus)

Motherboard peripherals are not Ivory internal registers; they are memory-mapped at full 32-bit physical addresses accessed via DTP-PHYSICAL-ADDRESS (#o40):

  • 0x08000000–0x08000003: Intel 82C54 Programmable Interval Timer
  • 0x09000000–0x090007FF: SGS-Thomson MK48T02 2 KB NVRAM & Time-of-Day Clock
  • 0x0A000000–0x0A00000C: Merlin-II Diagnostic LEDs (+0x0), Cache Control (+0x4), VME Timeout (+0x8), Interrupt Status (+0xC)
  • 0x40000000–0x4000FFFF: I/O Board 0 64 KW DMA SRAM
  • 0x44014000–0x4402D001: IO0 peripherals (SCN68562 DUSCC, 8237A DMAC, WD33C93A SCSI, DP8466 ESDI, Video / Intel 82586 Ethernet control)
  • 0x48000000: 512 KW Monochrome Console VRAM (1152×896)

See Volume 3: Virtual Memory, Paging & GC and Volume 4: Merlin-II Core & VMEbus for full register-level bitfields.

Related Chip Datasheets (13)All Component Datasheets →