The Execute Subroutine (Digital-7-95-U) enables users to execute any sequence of instructions anywhere in a program as if it were a subroutine, effectively extending the single-instruction execute (XCT) command. It is compatible with normal 4K or 8K PDP-4 or PDP-7 systems and occupies 1058 memory locations, but it is not designed for use with extended memory. The subroutine provides storage for pushdown stacks, allowing for up to five levels of nested subroutine calls, and ensures that the accumulator and link contents are preserved upon return.
To utilize the subroutine, the system must first be initialized by issuing the XCTSET command. Subroutines are then called using the XXCT pseudo-command, which takes two arguments: ADDR1 (the first instruction to be executed) and ADDR2 (the instruction that, when reached, triggers a return to the main program). The system handles stack management and memory restoration automatically.
Restrictions include its incompatibility with extended memories or when the computer is in extend mode. The XXCT command must not be issued by a normal PDP-7 XCT instruction. The only defined error halt occurs if the nesting depth exceeds the five-level limit. Entering and exiting a subroutine requires 77 cycles, equating to approximately 135 µsec on a PDP-7 or 616 µsec on a PDP-4. This subroutine is particularly useful during debugging and testing for executing specific code portions without formal subroutine coding.
Site structure and layout ©2025 Majenko Technologies