M-1091 MAC Nov60

Order Number: XX-98F6B-08

This document describes MAC (Master Control System), a subroutine control system developed for the PDP-1 computer, aimed at simplifying subroutine programming.

Key Advantages of MAC:

  1. Memory Efficiency: Reduces the number of memory registers required for writing closed subroutines.
  2. Recursion: Enables subroutines to call themselves, or other subroutines that may in turn call the original one.
  3. Simplification: Streamlines the process of writing subroutines.

Core Functionality: MAC occupies 174 (octal) memory locations, plus additional storage for subroutine returns and recursive operations. It leverages the PDP-1's "cal" instruction, interpreting its address part as the location of the target subroutine.

  • Subroutine Entry and Exit: Subroutines are called via cal abc (where abc is the subroutine's entry point). MAC handles the initial jump to abc. Subroutine exits must be handled through specific MAC instructions (e.g., jmp ral, jmp rml, cal ran, jsp rmn), which allow returning to various locations relative to the original cal instruction (e.g., L+1, L+2, L+n) and dictate the state of the Accumulator (AC) upon return (either preserved or reset from MAC's internal "Master Accumulator," mac).

  • Calling-Sequence Parameters: MAC enables subroutines to access parameters listed in registers immediately following the cal instruction. This is done through a process called "displaying," where MAC stores the locations of these parameters (not the parameters themselves) in special registers (ipl, rpl, etc.) for indirect addressing. ipl handles "immediate" parameters (direct values), while rpl supports "remote" parameters (locations of values, potentially multi-level indirect). While the first parameter is automatically displayed, additional parameters (up to seven) can be displayed using instructions like jsp dpn.

  • Recursion Support: MAC fully supports recursive subroutines by automatically protecting the return location. For subroutine-specific storage, MAC provides instructions (jsp spn) to save a specified number of registers. This saving operation should occur before the protected storage is used, and MAC automatically restores the storage upon subroutine exit. MAC's design prioritizes efficiency by having subroutines protect their caller's storage, rather than their own, minimizing save/restore operations.

The system's design emphasizes storage conservation, with potential for future extensions that might involve trade-offs in memory or execution time. The document's Appendix provides a summary of MAC's operations and their associated execution times.

XX-98F6B-08
May 1960
8 pages
Quality

Original
0.4MB

Site structure and layout ©2025 Majenko Technologies