The City & Guilds Mnemonic Code and its associated City & Guilds Computer was a specification for an assembler language and a virtual computer system that ran it. It was introduced in 1964 by the City and Guilds of London Institute and used as the basis for a number of computer programming and administration courses. The computer model was deliberately very simple, and operational systems were implemented as interpreters on a number of mainframe computers like the ICL 1900 series and Elliot 900 family. An updated version was released in 1968.
The City and Guilds of London Institute (C&G) has been offering a wide variety of vocational and apprenticeship programs since the late 19th century. In the early 1960s, the first computer systems were beginning to rapidly proliferate in large companies, and C&G decided to introduce a series of programs on computer operation and programming. [1]
The City & Guilds Mnemonic Code addressed the problem of widespread incompatibility across platforms by introducing a single new assembler language that could then be interpreted in a virtual machine on any sufficiently powerful platform. The system was deliberately simplified to make the number of machines that could run it as large as possible. It also added a number of features one would not normally associate with assembler, including the standard data format being floating point and including a number of features for advanced mathematics and string handling that would normally be expected in a high level language like BASIC. [1]
The first release was in 1964, and used in two courses, Basic and Advanced Certificates for Computer Personnel. The system was updated in 1968 as the Revised Mnemonic Code, at which time the Basic course became the Certificate in Computer Programming and Information Processing. [1]
The virtual computer was an oddity in that its basic data type was the floating point number, [2] as opposed to the majority of real-world machines which used binary integers, or for business-oriented machines of the era, binary coded decimal. In addition to the low-level commands found in most assemblers, like loading data from memory or bit shifting, C&G also included multiplication and division, as well as a number of more advanced features like exponents and trigonometric functions. A memory location could alternately hold one character. [2]
The computer was defined to have a main memory of 1,000 words. The first ten addresses could be used as index registers but also had special meanings. Location zero was permanently set to the value zero, while 1 was the accumulator and 4 held the return address during subroutine calls. In the revised edition, 5 was used with the LOP
instruction and 6 and 7 were used to specify the format when converting from characters to numbers using the CNC
instruction. [2] [3]
The machine was an accumulator design. Most instructions took two operands pointing into the main memory, referred to as n and m. n was normally a 12-bit value 0 through 999, while m selected one of the registers, 0 through 9. The value in that register was added to n to produce a complete address. For instance, the ADD
instruction read the two operands, added the value in the selected register m to the constant value n, and then accessed the value at the resulting memory location, referred to as C. [4]
In the documentation, if the value in question was read from a memory location it was indicated in parens, so most instructions were of the form n+(m), meaning that the value in the register/memory location m was added to the constant value n. Addition performed the operation A = A + (n+(m))
, meaning the value in register m was added to the constant value n, and then the value in the resulting memory location, (n+(m)), was added to the value already in the accumulator. [3]
The system was created before ASCII had been standardized, and, as was typical for machines of the era, used its own custom character set. This held 0 to 9 in locations 0 to 9, A to Z in 10 through 35, and then a number of symbols for a total of 64 characters. [5] [6] [lower-alpha 1]
The system lacked any facility for including code comments. It also lacked symbolic labels, so if the program added or removed lines, the programmer had to manually update the locations of branches. [3]
The instructions in the Mnemonic Code can be broken into three broad categories, basic math and logic operations that closely mirror most assembler languages, additional mathematical operations, and input/output operations. One curious addition is the "Q", for "query", which could be added to the front of any instruction. When Q was encountered, the interpreter would run the instruction and then output debugging information to the printer. [3]
The instructions, depending on the version, were stored internally in the format:
FF [Q] nnn m
FF, the "order number", was the numerical instruction opcode. Q indicated the query function, and nnn and m were three-digit and one-digit values for n and m. Numbers were entered in decimal format. [3]
The system broke down its basic arithmetic and logical operations into several groups for organizational purposes. Unless otherwise specified, the lists are from the Elliot 903 documentation. [7]
Group 0, accumulator/memory operations:
Opcode | Mnemonic | Operation |
---|---|---|
00 | LDA n,m | Load the data stored in location n+(m) into the accumulator |
01 | ADD n,m | Add the value stored in n+m to the value in the accumulator, A = A + (n+(m)) |
02 | SUB n,m | Subtract the value at n+m from the value in the accumulator, A = A – (n+(m)) |
03 | MLT n,m | Multiply the value stored in n+m to the value in the accumulator, A = A x (n+(m)) |
04 | DIV n,m | Divide the value at n+m from the value in the accumulator, A = A / (n+(m)) |
Group 1, accumulator/constant operations, with a single operand holding an integer value. In the original specification only n was used, in the 1968 revision, m can be optionally supplied and its value added to the constant in n. [3]
Opcode | Mnemonic | Operation |
---|---|---|
10 | LDAN n | Load the constant 0 through 999 into the accumulator |
11 | ADDN n | Add the value to the accumulator, A = A + n [+(m)] |
12 | SUBN n | Subtract the value at n+m from the value in the accumulator, A = A – n [+(m)] |
13 | MLTN n | Multiply the value stored in n+m to the value in the accumulator, A = A x n [+(m)] |
14 | DIVN n | Divide the value at n+m from the value in the accumulator, A = A / n [+(m)] |
Group 2, store value:
Opcode | Mnemonic | Operation |
---|---|---|
20 | STA n,m | Store the accumulator's value to location n+(m) |
Group 3, test and branch:
Opcode | Mnemonic | Operation |
---|---|---|
30 | JUN n,m | Jump to n+m (unconditional jump) |
31 | JGR n,m | Jump to n+m if the accumulator is > 0 |
32 | JEQ n,m | Jump to n+m if the accumulator is 0 |
33 | JSR n,m | Write the return address to location 4, and jump to n+(m) (jump to subroutine) |
34 | JST n,m | Stop execution, when user presses GO, pick up at n+(m) |
The Revised edition changed some of the codes and added new ones. The list in this section is from the ICL documentation: [8]
Opcode | Mnemonic | Operation |
---|---|---|
30 | JUN n,m | Jump to n+m (unconditional jump) |
31 | JEQ n,m | Jump to n+m if the accumulator is 0 |
32 | JNE n,m | Jump to n+m if the accumulator is not 0 |
33 | JLE n,m | Jump to n+m if the accumulator is <= 0 |
34 | JGE n,m | Jump to n+m if the accumulator is >= 0 |
35 | JLT n,m | Jump to n+m if the accumulator is < 0 |
36 | JGR n,m | Jump to n+m if the accumulator is >= 0 |
37 | JSR n,m | Write the return address to location 4, and jump to n+(m) (jump to subroutine) |
38 | JST n,m | Stop execution, when user presses GO, pick up at n+(m) |
39 | LOP n,m | Decrement the value in register 5, then jump to n+(m) if the value > 0 |
The LOP instruction is used to implement loops; by placing the number of iterations in register 5, LOP will decrement the value each time and then jump back to the top of the loop. [8]
Group 4 are a set of standard math functions: [9]
Opcode | Mnemonic | Operation |
---|---|---|
40 | SQT n,m | Square root of the value in A. If n+(m) is non-zero, an error will leave A unchanged and jump to that location. If n+(m) is zero, errors cause execution to stop. |
41 | EXP n,m | Exponent of the value in A. Overflows jump to n+(m) |
42 | LGN n,m | Natural logarithm of the value in A. Overflows jump to n+(m) |
43 | SIN | Sine of the value in A |
44 | COS | Cosine of the value in A |
45 | ARC | Arctangent of the value in A |
46 | ENT | Integer part of the value in A |
Group 5, 6 and 7 are the input/output instructions. There are significant differences between the two known versions, ICL and Elliot, but it is not clear whether these are differences due to the Elliot version being the earlier specification, or whether it is due to the machine lacking tape and disk support and thus simply removing instructions related to those devices. The result is a relatively limited set of functions: [10] [3]
Opcode | Mnemonic | Operation |
---|---|---|
50 | RCT n,m | Read a single character from punch tape and store it at (n+(m)) |
51 | PCT n,m | Punch the character at (n+(m)) to tape |
52 | RNT n,m | Read a number from the tape into the accumulator |
53 | PNT n,m | Punch the number in the accumulator to tape |
52 | PNL | Punch a newline character |
60 | RCC n,m | Read all the characters on a punch card into memory starting at (n+(m)) |
61 | PCC n,m | Punch characters starting at (n+(m)) to a card |
62 | RNC n,m | Read number on card to (n+(m)) |
63 | PNC n,m | Punch number at (n+(m)) to card |
In contrast, the ICL version, which corresponds to the 1968 specification, is much more flexible. Its Computer had a single input and single output channel that could be connected to different devices. There were five devices defined, 10 was the paper tape reader, 30 was the card reader, 50 was magnetic tape, 60 was a disk pack, and 80 was a printer. [11] To use one of the devices, the ARD n, m
or AWD n, m
instruction was called, for read or write respectively, with the desired device number in (n+(m)). [12]
Once opened, the devices could be read and written using the various I/O instructions. These included separate instructions for numbers and characters, instructions to convert between the two, and various other instructions for particular operations like outputting a line feed or rewinding a tape. [11] A key feature was the concept of a "block", a group of related data that was read all at once. This was normally used to read and write character strings in a single instruction. The block ended with the £
character, known as the block character. [13] [3]
Opcode | Mnemonic | Operation |
---|---|---|
50 | ARD n,m | Allocate input to device number (n+(m)) |
51 | AWD n,m | Allocate output to device number (n+(m)) |
52 | RNA n,m | Read number from the input device into A, jump to n+(m) on any error |
53 | WNA n,m | Write the number in A to the output device. n and m holds numbers that defines the format to write (see below) |
60 | RCH n,m | Read one character and store it in n+(m) |
61 | WCH n,m | Write one character at (n+(m)), this may be the new line character |
62 | RNB n,m | Read characters into memory starting at n+(m), stopping when the block character is seen |
63 | WNB n,m | Write a block of characters from memory starting at n+(m) |
64 | WNL n,m | Write a sequence of n+(m) newline characters |
65 | WSS n,m | Write a sequence of n+(m) space characters |
66 | CNN n,m | Convert the string at n+(m) into a number in A |
67 | CNC n,m | Convert the number in A to a string at n+(m) |
70 | ACB n,m | Access block number n+(m). Normally used with hard disks, with other devices is moves forward n+(m) blocks |
71 | BSP n,m | Backspace to block number n+(m). Only legal on hard disks |
72 | RWD | Rewind. Only legal on magnetic tape drives |
Opcode | Mnemonic | Operation |
---|---|---|
99 | STOP | Stop execution |
As a major goal of the system was to read and write data to various real-world devices, the Code included a formatting system similar to printf format strings to ease the task of outputting readable text. The format is stored as a value in memory, at n+(m) for most instructions, or in locations 6 and 7 for the CNC instruction, which uses n+(m) to define the output location. There are four basic formats, all of which begin with a leading space and plus or minus sign: [14]
type | n and m | results |
---|---|---|
complete | n=0, m=0 | write all the digits in the number including a period at the decimal place |
integers | n>=1, m=0 | write n digits of the integer part, ignore any fractional part |
mixed | n>=1, m<>0 | write n digits of integer, a period, m digits of fraction |
floating point | n=9, m<>0 | write a leading period, m digits of fraction, "E", and two digits of exponent |
In addition to the machine instructions, the language also included a small number of directives: [15] [16] [3]
In addition to the Mnemonic Code, the Computer also defined a basic operating environment, like the BASIC language. This included LOAD and SAVE, ON to redirect the input or output device, and GO to start execution. [17]
This example, from Herbert, calculates and prints PI. Written for the Elliot 903, this uses the earlier PNT
I/O command, which prints to the punch tape. [18]
(TITLE) SIMPLE TEST (STORE 12) LDAN 1 ARC 16 MLTN 4 PNT 1,6 JST (EXECUTE 12)
When run, with the GO
command, this program will produce:
SIMPLE TEST 3.141593
In a computer's central processing unit (CPU), the accumulator is a register in which intermediate arithmetic logic unit results are stored.
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.
The PDP-8 is a family of 12-bit minicomputers 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.
The LINC is a 12-bit, 2048-word transistorized computer. The LINC is considered by some to be the first minicomputer and a forerunner to the personal computer. Originally named the Linc, suggesting the project's origins at MIT's Lincoln Laboratory, it was renamed LINC after the project moved from the Lincoln Laboratory. The LINC was designed by Wesley A. Clark and Charles Molnar.
The IBM 650 Magnetic Drum Data-Processing Machine is an early digital computer produced by IBM in the mid-1950s. It was the first mass-produced computer in the world. Almost 2,000 systems were produced, the last in 1962, and it was the first computer to make a meaningful profit. The first one was installed in late 1954 and it was the most popular computer of the 1950s.
MIX is a hypothetical computer used in Donald Knuth's monograph, The Art of Computer Programming (TAOCP). MIX's model number is 1009, which was derived by combining the model numbers and names of several contemporaneous, commercial machines deemed significant by the author. Also, "MIX" read as a Roman numeral is 1009.
The IBM 700/7000 series is a series of large-scale (mainframe) computer systems that were made by IBM through the 1950s and early 1960s. The series includes several different, incompatible processor architectures. The 700s use vacuum-tube logic and were made obsolete by the introduction of the transistorized 7000s. The 7000s, in turn, were eventually replaced with System/360, which was announced in 1964. However the 360/65, the first 360 powerful enough to replace 7000s, did not become available until November 1965. Early problems with OS/360 and the high cost of converting software kept many 7000s in service for years afterward.
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.
The Simplified Instructional Computer is a hypothetical computer system introduced in System Software: An Introduction to Systems Programming, by Leland Beck. Due to the fact that most modern microprocessors include subtle, complex functions for the purposes of efficiency, it can be difficult to learn systems programming using a real-world system. The Simplified Instructional Computer solves this by abstracting away these complex behaviors in favor of an architecture that is clear and accessible for those wanting to learn systems programming.
The HP 2100 is a series of 16-bit minicomputers that were produced by Hewlett-Packard (HP) from the mid-1960s to early 1990s. Tens of thousands of machines in the series were sold over its twenty-five year lifetime, making HP the fourth largest minicomputer vendor during the 1970s.
In computer engineering, an orthogonal instruction set is an instruction set architecture where all instruction types can use all addressing modes. It is "orthogonal" in the sense that the instruction type and the addressing mode vary independently. An orthogonal instruction set does not impose a limitation that requires a certain instruction to use a specific register so there is little overlapping of instruction functionality.
The Western Design Center (WDC) 65C02 microprocessor is an enhanced CMOS version of the popular nMOS-based 8-bit MOS Technology 6502. It uses less power than the original 6502, fixes several problems, and adds new instructions. The power usage is on the order of 10 to 20 times less than the original 6502 running at the same speed; its reduced power consumption has made it useful in portable computer roles and industrial microcontroller systems. The 65C02 has also been used in some home computers, as well as in embedded applications, including medical-grade implanted devices.
CESIL, or Computer Education in Schools Instruction Language, is a programming language designed to introduce pupils in British secondary schools to elementary computer programming. It is a simple language containing a total of fourteen instructions.
NAR 2 is a theoretical model of a 32-bit word computer created by Faculty of Mathematics of University of Belgrade professor Nedeljko Parezanović as an enhancement to its predecessor, NAR 1. It was used for Assembly language and Computer architecture courses. The word "nar" means Pomegranate in Serbian. Many NAR 2 simulators have been created — for instance, one was named "Šljiva" as that fruit grows in Serbia, while "nar" does not.
The Elliott 803 is a small, medium-speed transistor digital computer which was manufactured by the British company Elliott Brothers in the 1960s. About 211 were built.
The Little Man Computer (LMC) is an instructional model of a computer, created by Dr. Stuart Madnick in 1965. The LMC is generally used to teach students, because it models a simple von Neumann architecture computer—which has all of the basic features of a modern computer. It can be programmed in machine code or assembly code.
The D-37C (D37C) is the computer component of the all-inertial NS-17 Missile Guidance Set (MGS) for accurately navigating to its target thousands of miles away. The NS-17 MGS was used in the Minuteman II (LGM-30F) ICBM. The MGS, originally designed and produced by the Autonetics Division of North American Aviation, could store multiple preprogrammed targets in its internal memory.
Ferranti's Sirius was a minicomputer released in 1961. Designed to be used in smaller offices without a dedicated programming staff, the Sirius used decimal arithmetic instead of binary, supported Autocode to ease programming, was designed to fit behind a standard office desk, and ran on UK standard mains electricity with no need for cooling. It was also fairly slow, with instruction speeds around 4,000 operations per second, and had limited main memory based on delay lines, but as Ferranti pointed out, its price/performance ratio was difficult to beat.
ICT 1900 was a family of mainframe computers released by International Computers and Tabulators (ICT) and later International Computers Limited (ICL) during the 1960s and 1970s. The 1900 series was notable for being one of the few non-American competitors to the IBM System/360, enjoying significant success in the European and British Commonwealth markets.
The Hack Computer is a theoretical computer design created by Noam Nisan and Shimon Schocken and described in their book, The Elements of Computing Systems: Building a Modern Computer from First Principles. In using the term “modern”, the authors refer to a digital, binary machine that is patterned according to the von Neumann architecture model.