City & Guilds Mnemonic Code

Last updated

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.

Contents

History

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]

Description

The 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, whilst 1 was the accumulator. 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]

Instructions

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]

Basic operations

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:

OpcodeMnemonicOperation
00LDA n,mLoad the data stored in location n+(m) into the accumulator
01ADD n,mAdd the value stored in n+m to the value in the accumulator, A = A + (n+(m))
02SUB n,mSubtract the value at n+m from the value in the accumulator, A = A - (n+(m))
03MLT n,mMultiply the value stored in n+m to the value in the accumulator, A = A x (n+(m))
04DIV n,mDivide 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]

OpcodeMnemonicOperation
10LDAN nLoad the constant 0 through 999 into the accumulator
11ADDN nAdd the value to the accumulator, A = A + n [+(m)]
12SUBN nSubtract the value at n+m from the value in the accumulator, A = A - n [+(m)]
13MLTN nMultiply the value stored in n+m to the value in the accumulator, A = A x n [+(m)]
14DIVN nDivide the value at n+m from the value in the accumulator, A = A / n [+(m)]

Group 2, store value:

OpcodeMnemonicOperation
20STA n,mStore the accumulator's value to location n+(m)

Group 3, test and branch:

OpcodeMnemonicOperation
30JUN n,mJump to n+m (unconditional jump)
31JGR n,mJump to n+m if the accumulator is > 0
32JEQ n,mJump to n+m if the accumulator is 0
33JSR n,mWrite the return address to location 4, and jump to n+(m) (jump to subroutine)
34JST n,mStop 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]

OpcodeMnemonicOperation
30JUN n,mJump to n+m (unconditional jump)
31JEQ n,mJump to n+m if the accumulator is 0
32JNE n,mJump to n+m if the accumulator is not 0
33JLE n,mJump to n+m if the accumulator is <= 0
34JGE n,mJump to n+m if the accumulator is >= 0
35JLT n,mJump to n+m if the accumulator is < 0
36JGR n,mJump to n+m if the accumulator is >= 0
37JSR n,mWrite the return address to location 4, and jump to n+(m) (jump to subroutine)
38JST n,mStop execution, when user presses GO, pick up at n+(m)
39LOP n,mDecrement 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]

Extended math

Group 4 are a set of standard math functions: [9]

OpcodeMnemonicOperation
40SQT n,mSquare 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.
41EXP n,mExponent of the value in A. Overflows jump to n+(m)
42LGN n,mNatural logarithm of the value in A. Overflows jump to n+(m)
43SINSine of the value in A
44COSCosine of the value in A
45ARCArctangent of the value in A
46ENTInteger part of the value in A

Input/output

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]

OpcodeMnemonicOperation
50RCT n,mRead a single character from punch tape and store it at (n+(m))
51PCT n,mPunch the character at (n+(m)) to tape
52RNT n,mRead a number from the tape into the accumulator
53PNT n,mPunch the number in the accumulator to tape
52PNLPunch a newline character
60RCC n,mRead all the characters on a punch card into memory starting at (n+(m))
61PCC n,mPunch characters starting at (n+(m)) to a card
62RNC n,mRead number on card to (n+(m))
63PNC n,mPunch 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]

OpcodeMnemonicOperation
50ARD n,mAllocate input to device number (n+(m))
51AWD n,mAllocate output to device number (n+(m))
52RNA n,mRead number from the input device into A, jump to n+(m) on any error
53WNA n,mWrite the number in A to the output device. n and m holds numbers that defines the format to write (see below)
60RCH n,mRead one character and store it in n+(m)
61WCH n,mWrite one character at (n+(m)), this may be the new line character
62RNB n,mRead characters into memory starting at n+(m), stopping when the block character is seen
63WNB n,mWrite a block of characters from memory starting at n+(m)
64WNL n,mWrite a sequence of n+(m) newline characters
65WSS n,mWrite a sequence of n+(m) space characters
66CNN n,mConvert the string at n+(m) into a number in A
67CNC n,mConvert the number in A to a string at n+(m)
70ACB n,mAccess block number n+(m). Normally used with hard disks, with other devices is moves forward n+(m) blocks
71BSP n,mBackspace to block number n+(m). Only legal on hard disks
72RWDRewind. Only legal on magnetic tape drives

Other instructions

OpcodeMnemonicOperation
99STOPStop execution

Number formatting

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]

typen and mresults
completen=0, m=0write all the digits in the number including a period at the decimal place
integersn>=1, m=0write n digits of the integer part, ignore any fractional part
mixedn>=1, m<>0write n digits of integer, a period, m digits of fraction
floating pointn=9, m<>0write a leading period, m digits of fraction, "E", and two digits of exponent

Assembler directives

In addition to the machine instructions, the language also included a small number of directives: [15] [16] [3]

(TITLE)
prints the following line to the output device
(STORE n)
sets the starting location of the following code. Several STOREs can be used in a single program
(WAIT)
stops execution and waits for a GO instruction from the operator
(EXECUTE n)
indicates the end of the program code and sets the initial program counter location when the program is run

Operating environment

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]

Example

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

Notes

  1. The ICL documentation uses section numbers throughout, but some pages also have a page number in the header. Page numbers are used where available, sections otherwise.

See Also

Related Research Articles

<span class="mw-page-title-main">Accumulator (computing)</span> Register in which intermediate arithmetic and logic results of a CPU are stored

In a computer's central processing unit (CPU), the accumulator is a register in which intermediate arithmetic logic unit results are stored.

<span class="mw-page-title-main">Data General Nova</span> 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.

<span class="mw-page-title-main">EDSAC</span> 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.

<span class="mw-page-title-main">PDP-8</span> Minicomputer product line

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.

<span class="mw-page-title-main">MCS-51</span> Single chip microcontroller series by Intel

The Intel MCS-51 is a single chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems. The architect of the Intel MCS-51 instruction set was John H. Wharton. Intel's original versions were popular in the 1980s and early 1990s, and enhanced binary compatible derivatives remain popular today. It is a complex instruction set computer, but also has some of the features of RISC architectures, such as a large register set and register windows, and has separate memory spaces for program instructions and data.

<span class="mw-page-title-main">LINC</span> Laboratory Instrument Computer (1962)

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.

<span class="mw-page-title-main">IBM 650</span> Vacuum tube computer system

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.

<span class="mw-page-title-main">IBM 1130</span> 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.

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.

<span class="mw-page-title-main">HP 2100</span> Mid-1960s 16-bit computer series by Hewlitt Packard

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.

<span class="mw-page-title-main">WDC 65C02</span> 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. 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.

<span class="mw-page-title-main">Elliott 803</span>

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.

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.

References

Citations

  1. 1 2 3 Herbert 2015, p. 20.
  2. 1 2 3 Computer, p. 1.
  3. 1 2 3 4 5 6 7 8 9 Herbert 2015.
  4. Computer, p. 3.
  5. Computer, p. 7.
  6. ICL, p. 2.6.
  7. Computer, p. 4.
  8. 1 2 ICL.
  9. Computer, p. 6.
  10. Computer, pp. 6–7.
  11. 1 2 ICL, p. 13.
  12. ICL, p. 11.
  13. ICL, p. 5.0.
  14. ICL, p. 6.1.
  15. ICL, p. 2.8.
  16. Computer, pp. 2–3.
  17. ICL, p. 13.0.
  18. Herbert 2015, p. 25.

Bibliography