Wheeler Jump

Last updated

The Wheeler Jump is a type of subroutine call methodology that was used on some early computers that lacked hardware support for saving the return address. The concept was developed by David Wheeler while working on the pioneering EDSAC machine in the 1950s. EDSAC had not been built with subroutines in mind, and lacked a suitable processor register or a hardware stack that might allow the return address to be easily stored.

Wheeler's solution was a particular way to write the subroutine code. To implement it, the last line of the subroutine was a "jump to this address" instruction, which would normally be followed by a memory location. In a Wheeler subroutine, this address was normally set to a dummy number, say 0.

To call the routine, the address of the caller would be placed in the accumulator and then the code would jump to the starting point of the routine. The first instructions in the routine would calculate the return address based on the value in the accumulator, typically the next memory location so an increment will suffice, and then write the result to the dummy address previously set aside. When the routine runs its course it naturally reaches the end of the routine which now says "jump to the return address".

As writing to memory is a slow process compared to register access, this methodology is not particularly fast. The addition of new registers for this sort of duty was a key design goal of EDSAC 2.

Example

This example demonstrates the technique using a pseudo-assembler language for a simple byte-oriented accumulator-based machine with a single register, A:

 'prepare to call the subroutine 10 COPY PC TO A  ' copy the program counter (10) into the accumulator 11 JUMP          ' jump to... 12 70            ' ... location 70 ... many more lines... 70 ADD CONST     ' add the following value to the accumulator... 71 3             ' ... three locations past the original PC value 72 STORE         ' store the value in the accumulator to... 73 91            ' ... the set-aside  memory location ... lines that perform the actual subroutine... 90 JUMP          ' return to... 91 0             ' ... which will be replaced by 13

When this code completes, the JUMP instruction in address 90 will naturally return to location 13, the next instruction after the subroutine.

Related Research Articles

Data General Nova 16-bit minicomputer series

The Data General Nova is a series of 16-bit minicomputers released by the American company Data General. The Nova family was very popular in the 1970s and ultimately sold tens of thousands of units.

EDSAC 1940s-1950s British computer

The Electronic delay storage automatic calculator (EDSAC) was an early British computer. Inspired by John von Neumann's seminal First Draft of a Report on the EDVAC, the machine was constructed by Maurice Wilkes and his team at the University of Cambridge Mathematical Laboratory in England. EDSAC was the second electronic digital stored-program computer to go into regular service.

PDP-8 First commercially successful minicomputer

The PDP-8 is a 12-bit minicomputer that was produced by Digital Equipment Corporation (DEC). It was the first commercially successful minicomputer, with over 50,000 units being sold over the model's lifetime. Its basic design follows the pioneering LINC but has a smaller instruction set, which is an expanded version of the PDP-5 instruction set. Similar machines from DEC are the PDP-12 which is a modernized version of the PDP-8 and LINC concepts, and the PDP-14 industrial controller system.

In computer science, threaded code is a programming technique where the code has a form that essentially consists entirely of calls to subroutines. It is often used in compilers, which may generate code in that form or be implemented in that form themselves. The code may be processed by an interpreter or it may simply be a sequence of machine code call instructions.

IBM 1130 16-bit IBM minicomputer introduced in 1965

The IBM 1130 Computing System, introduced in 1965, was IBM's least expensive computer at that time. A binary 16-bit machine, it was marketed to price-sensitive, computing-intensive technical markets, like education and engineering, succeeding the decimal IBM 1620 in that market segment. Typical installations included a 1 megabyte disk drive that stored the operating system, compilers and object programs, with program source generated and maintained on punched cards. Fortran was the most common programming language used, but several others, including APL, were available.

RCA 1802 Early microprocessor

The COSMAC is an 8-bit microprocessor family introduced by RCA. It is historically notable as the first CMOS microprocessor. The first production model was the two-chip CDP1801R and CDP1801U, which were later combined into the single-chip CDP1802. The 1802 represented the majority of COSMAC production, and today the entire line is known simply as the RCA 1802.

Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how the machine language instructions in that architecture identify the operand(s) of each instruction. An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.

The COP8 microcontroller from National Semiconductor is an 8-bit CISC core microcontroller, whose main features are:

In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack". Although maintenance of the call stack is important for the proper functioning of most software, the details are normally hidden and automatic in high-level programming languages. Many computer instruction sets provide special instructions for manipulating stacks.

In computer science, a calling convention is an implementation-level (low-level) scheme for how subroutines receive parameters from their caller and how they return a result. Differences in various implementations include where parameters, return values, return addresses and scope links are placed, and how the tasks of preparing for a function call and restoring the environment afterwards are divided between the caller and the callee.

WDC 65C02 CMOS microprocessor in the 6502 family

The Western Design Center (WDC) 65C02 microprocessor is an enhanced CMOS version of the popular nMOS-based 8-bit MOS Technology 6502. The 65C02 fixed several problems in the original 6502 and added some new instructions, but its main feature was greatly lowered power usage, on the order of 10 to 20 times less than the original 6502 running at the same speed. The reduced power consumption made the 65C02 useful in portable computer roles and microcontroller systems in industrial settings. It has been used in some home computers, as well as in embedded applications, including medical-grade implanted devices.

The CSG 65CE02 is an 8/16-bit microprocessor developed by Commodore Semiconductor Group in 1988. It is a member of the MOS Technology 6502 family, developed from the CMOS WDC 65C02 released by the Western Design Center in 1983.

The 65xx family of microprocessors, consisting of the MOS Technology 6502 and its derivatives, the WDC 65C02, WDC 65C802 and WDC 65C816, and CSG 65CE02, all handle interrupts in a similar fashion. There are three hardware interrupt signals common to all 65xx processors and one software interrupt, the BRK instruction. The WDC 65C816 adds a fourth hardware interrupt—ABORT, useful for implementing virtual memory architectures—and the COP software interrupt instruction, intended for use in a system with a coprocessor of some type.

A stack register is a computer central processor register whose purpose is to keep track of a call stack. On an accumulator-based architecture machine, this may be a dedicated register such as SP on an Intel x86 machine. On a general register machine, it may be a register which is reserved by convention, such as on the PDP-11 or RISC machines. Some designs such as the Data General Eclipse had no dedicated register, but used a reserved hardware memory address for this function.

The PDP-11 architecture is a CISC instruction set architecture (ISA) developed by Digital Equipment Corporation (DEC). It is implemented by central processing units (CPUs) and microprocessors used in PDP-11 minicomputers. It was in wide use during the 1970s, but was eventually overshadowed by the more powerful VAX-11 architecture in the 1980s.

ST6 and ST7

The ST6 and ST7 are 8-bit microcontroller product lines from STMicroelectronics. They are commonly used in small embedded applications like washing machines.

In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed.

The 12-bit ND812, produced by Nuclear Data, Inc., was a commercial minicomputer developed for the scientific computing market. Nuclear Data introduced it in 1970 at a price under $10,000.

Western Digital WD16 Western Digital WD16

The WD16 is a 16-bit microprocessor introduced by Western Digital in October 1976. It is based on the MCP-1600 chipset, which formed the basis of the DEC LSI-11 low-end minicomputer and the Pascal MicroEngine processor designed specifically to run the UCSD p-System efficiently. Each used different microcode. The WD16 implements an extension of the PDP-11 instruction set architecture but is not machine code compatible with the PDP-11. The WD16 is an extreme example of CISC architecture. Most two-operand instructions can operate memory-to-memory and some instructions can result in up to ten memory accesses.

COP400

The COP400 or COP II is a 4-bit microcontroller family introduced in 1977 by National Semiconductor as a follow-on product to their original PMOS COP microcontroller. COP400 family members are complete microcomputers containing internal timing, logic, ROM, RAM and I/O necessary to implement dedicated controllers. Some COP400 devices were second-sourced by Western Digital as the WD4200 family.

References