<
 
 
 
 
×
>
hide You are viewing an archived web page, collected at the request of University of Michigan Bentley Historical Library using Archive-It. This page was captured on 20:12:38 Jan 11, 2011, and is part of the University of Michigan Schools, Colleges, Research, Centers, and Institutes Web Archives collection. The information on this web page may be out of date. See All versions of this archived page. Loading media information

MAD (programming language)

From Wikipedia, the free encyclopedia
  (Redirected from MAD/I)
Jump to: navigation, search
MAD: Michigan Algorithm Decoder
Paradigm imperative
Appeared in 1959
Developer Galler, Arden, and Graham
Major implementations IBM 704, IBM 7090, UNIVAC 1108, Philco 210-211, IBM S/360, and IBM S/370
Dialects MAD, MAD/I, GOM
Influenced by IAL, ALGOL 58
OS UMES, MTS, CTSS, others

MAD (short for Michigan Algorithm Decoder), is a programming language and compiler developed at the University of Michigan by Bernard Galler, Bruce Arden and Robert M. Graham.[1]

[edit] MAD, MAD/I, and GOM

There are three MAD compilers:

  1. Original MAD, the compiler developed in 1959 at the University of Michigan for the IBM 704 and later the IBM 709 and IBM 7090 mainframe computers running the University of Michigan Executive System (UMES) and the Compatible Time-Sharing System (CTSS) operating systems.[2][3] In the mid-1960s MAD was ported at the University of Maryland to the UNIVAC 1108.[4] Versions of MAD were also available for the Philco 210-211 and UNIVAC 1107.[4]
  2. MAD/I, an "extended" version of MAD for the IBM S/360 series of computers running under the Michigan Terminal System (MTS). Work on the new compiler started in 1965 as part of the ARPA sponsored CONCOMP project at the University of Michigan. As work progressed it gradually became clear that MAD/I was a new language independent of the original 7090 version of MAD.[5]
  3. GOM (Good Old MAD), a reimplementation of the original 7090 MAD for the IBM S/370 series of mainframe computers running the Michigan Terminal System (MTS). GOM was created in the early 1980s by Don Boettner at the University of Michigan Computing Center.[6][7]

[edit] History

MAD is a variant of the International algorithmic language (IAL). IAL is the original name for what eventually became ALGOL 58. While MAD was motivated by ALGOL 58, it does not resemble ALGOL 58 in any significant way.[8][9]

Programs written in MAD included MAIL[10], RUNOFF, one of the first text processing systems, and several other utilities all under Compatible_Time-Sharing_System(CTSS)[11]. Work was done on a design for a MAD compiler for Multics, but it was never implemented.[12]

The following is an interesting quote from An Interview with Brian Kernighan[13] when he was asked "What hooked you on programming?":

I think that the most fun I had programming was a summer job at Project MAC at MIT in the summer of 1966, where I worked on a program that created a job tape for the brand new GE 645 in the earliest days of Multics. I was writing in MAD, which was much easier and more pleasant than the FORTRAN and COBOL that I had written earlier, and I was using CTSS, the first time-sharing system, which was infinitely easier and more pleasant than punch cards.

MAD was quite fast compared to some of the other compilers of its day. Because a number of people were interested in using the FORTRAN language and yet wanted to obtain the speed of the MAD compiler, a system called MADTRAN (written in MAD) was developed. MADTRAN was simply a translator from FORTRAN to MAD, which then produced machine code. MADTRAN was distributed through SHARE.[8]

MAD/I has a syntactic structure similar to ALGOL 60 together with important features from the original MAD and from PL/I.[5] MAD/I was designed as an extensible language. It was available for use under MTS and provided many new ideas which made their way into other languages, but MAD/I compilations were slow and MAD/I never extended itself into widespread use when compared to the original 7090 MAD.[7]

GOM is essentially the 7090 MAD language modified and extended for the 360/370 architecture with some judicious tailoring to better fit current programming practices and problems.[7] The MTS Message System was written in GOM.

[edit] MAD, MAD Magazine, and Alfred E. Neuman

Line printer output following a MAD compiler error on an IBM 704 computer at the University of Michigan, c. 1960

In a pre-release version of the original MAD, as a reference to MAD's namesake, MAD magazine, when a program contained too many compile time errors the compiler would print a full-page picture of Alfred E. Neuman using ASCII art. The caption read, "See this man about your program--He might want to publish it. He never worries--but from the looks of your program, you should."[4] This feature was not included in the final official version.[14]

And Bernie Galler remembers:

By the time we designed the language that we thought would be worth doing and for which we could do a compiler, we couldn't call it Algol any more; it really was different. That's when we adopted the name MAD, for the Michigan Algorithm Decoder. We had some funny interaction with the Mad Magazine people, when we asked for permission to use the name MAD. In a very funny letter, they told us that they would take us to court and everything else, but ended the threat with a P.S. at the bottom - "Sure, go ahead." Unfortunately, that letter is lost.[11]

[edit] "Hello, world" example

The "hello, world" example program prints the string "Hello, world" to a terminal or screen display.

PRINT FORMAT HELLOW
VECTOR VALUES HELLOW=$13h0Hello, world*$
END OF PROGRAM

The first character of the line is treated as logical carriage control, in this example the character zero which causes a double spaced line to be printed.

Or, if entering all of the keywords at your keypunch is too much work, you can use contractions and the compiler will expand them in the listing:

P'T HELLOW
V'S HELLOW=$13h0Hello, world*$
E'M

[edit] Language elements

MAD and GOM, but not MAD/I, are composed of the following elements:[3][7][8]

[edit] Input format

MAD programs are a series of statements written on punched cards, generally one statement per card, although a statement can be continued to multiple cards.

The first card for a statement has a blank or no punch in card column 11 and continuation cards contain the digits 0 through 9 in column 11. Comments or remarks are flagged using the letter "R" in column 11.

The character set supported includes the upper case letters A-Z, the digits 0-9, and the characters , (comma), + (plus), - (minus), ' (apostrophe), =, *, /, (, ), &, and blank or space. Lowercase letters and " (double quote) are not supported.

Spaces are not significant anywhere other than within character constants.

Few key words in the language are reserved words since since most are longer than six letters or are surrounded by periods. There is a standard set of abbreviations which can be used to replace the longer words. These consist of the first and last letters of the key words with an apostrophe between them, such as W'R for WHENEVER and D'N for DIMENSION.

For GOM:

[edit] Data types

MAD uses the term "mode" for its data types. Five basic modes are supported:

  1. Integer (-9,999,999,999 to +9,999,999,999)
    1. integer constants (1, +1, -1)
    2. octal constants (to 7777777777777K)
    3. treated as integers, written with or without a scale factor (1K10, 1K)
    4. alphabetic or character constants (1 to 6 characters delimited using the dollar sign ($ABCDEF$), double dollar-signs are used to enter a true dollar sign ($$$.56$ is 56 cents).
    5. treated as integers, stored left justified and padded on the right with from 0 to 5 blanks
  2. Floating Point (10−38 to 1038)
    1. written with a decimal point without an exponent (0., 1.5, -0.05, +100.4, -4.); or
    2. written with an exponent with or without a decimal point (.05E-2, -.05E2, 5E02, 5.E2)
  3. Boolean (1B for true and 0B for false)
  4. Statement Label
  5. Function Name
    1. written as a name followed by a period (SQRT.), where names are from one to six alphabetic characters or decimal digits long and must start with an alphabetic character

Strings longer than six characters may be represented using arrays.

The mode of a constant can be redefined by adding the character M followed by a single digit at the end of the constant, where 0 indicates floating point, 1 integer, 2 boolean, 3 function name, and 4 statement label.

Input-output lists, VECTOR VALUES statements, and some subroutines allow the use of block notation, which has the form A,...,B or A...B, which is a reference to the entire region from A to B, inclusive. In terms of a vector, A(1)...A(N) would be A(1), A(2), A(3), ..., A(N).

For GOM:

[edit] Names

For GOM:

[edit] Arrays

[edit] Operators

[edit] Arithmetic operators

  • .ABS. (unary absolute value)
  • + (unary identity)
  • - (unary negation)
  • + (addition)
  • - (subtraction)
  • * (multiplication)
  • / (division)
  • .P. (exponentiation)
  • .N. (bitwise negation)
  • .A. (bitwise and)
  • .V. (bitwise or)
  • .EV. (bitwise exclusive or)
  • .LS. (left shift)
  • .RS. (right shift)
  • .REM. (remainder, GOM only)

[edit] Pointer operators (GOM only)

  •  : (selection)
  • .LOC. (location)
  • .IND. (indirection)

[edit] Relational operators

  • .L. (less than)
  • .LE. (less than or equal)
  • .E. (equal)
  • .NE. (not equal)
  • .G. (greater than)
  • .GE. (greater than or equal)

[edit] Boolean operators

  • .NOT. (unary logical not)
  • .OR. (logical or)
  • .EXOR. (logical exclusive or)
  • .AND. (logical and)
  • .THEN. (implies)
  • .EQV. (equivalence)

[edit] Bit operators (GOM only)

  • .SETBIT. (set bit to 1)
  • .RESETBIT. (reset bit to 0)
  • .BIT. (test bit)

[edit] Expressions

Integer, floating point, and boolean expressions are provided. Integer and floating point variables and constants can be combined in a single expression with floating point as the result (parts of such computation may be performed using integer arithmetic and the final result may differ from those where the entire computation is done in floating point).

The left and right sides of an assignment must be of the same type, except that an integer or floating point expression on the right will be converted to a floating point or integer expression on the left if necessary.

[edit] Declaration statements

Variables may be implicitly or explicitly declared. By default all implicitly declared variables are assumed to be floating point. The NORMAL MODE IS statement may be used to change this default.

  • FLOATING POINT var1, var2, ... (may include dimension information)
  • INTEGER var1, var2, ... (may include dimension information)
  • BOOLEAN var1, var2, ... (may include dimension information)
  • FUNCTION NAME name1, name2, ... (may include dimension information)
  • STATEMENT LABEL label1, label2, ... (may include dimension information)
  • MODE NUMBER n, var1, var2, ... (may include dimension information)
  • NORMAL MODE IS type-name (INTEGER, BOOLEAN, FLOATING POINT, STATEMENT LABEL, or FUNCTION NAME)
  • NORMAL MODE IS MODE NUMBER n
  • DIMENSION variable(max-dimension) (declares an array from 0...max-dimension)
  • DIMENSION variable(from...to)
  • DIMENSION variable((subscript1, subscript2, ..., subscriptn) (declares a multidimensional array)
  • VECTOR VALUES array(n) = c1, c2, c3, ...
  • VECTOR VALUES array(m) ... array(n) = constant
  • DOUBLE STORAGE MODE mode-list (doubles the amount of storage allocated for the modes listed)
  • EQUIVALENCE (a1, a2, ..., am), ...
  • PROGRAM COMMON a, b, c, ... (may include dimension information)
  • ERASABLE a, b, c, ... (may include dimension information)
  • PARAMETER A1<(B1/sub>), A2(B2), ..., An(Bn)
  • SYMBOL TABLE VECTOR variable
  • FULL SYMBOL TABLE VECTOR variable
  • LISTING ON (the default)
  • LISTING OFF
  • REFERENCES ON
  • REFERENCES OFF (the default)

[edit] Executable statements

  • variable = expression (assignment)
  • TRANSFER TO statement-label
  • WHENEVER boolean-expression, executable-statement (simple conditional)
  • WHENEVER boolean-expression (compound conditional)
    • OR WHENEVER boolean-expression
    • OTHERWISE
    • END OF CONDITIONAL
  • CONTINUE (do nothing statement, usually used to carry a statement label)
  • THROUGH statement-label, FOR VALUES OF variable = expression-list (iteration)
  • SET LIST TO array-element, [ expression ]
  • SAVE DATA list
  • RESTORE DATA list
  • PAUSE NO. octal-integer (stop execution, print an octal number on the operators console, allow manual restart)
  • END OF PROGRAM (the last statement in all MAD programs)

[edit] Input and output statements

  • READ DATA (reads data using a self-defining format, var1=value1, var2=value2, ..., varN=valueN
  • READ AND PRINT DATA (similar to READ DATA, but data read is echoed to the printer)
  • READ FORMAT format, list
  • READ BCD TAPE n, format, list
  • READ BINARY TAPE n, list
  • PRINT RESULTS list
  • PRINT BCD RESULTS list
  • PRINT OCTAL RESULTS list
  • PRINT COMMENT $string$ (first character of string is carriage control)
  • PRINT FORMAT format, list
  • PRINT ON LINE FORMAT format, list (display a message for the machine operator)
  • WRITE BCD TAPE n, format, list
  • WRITE BINARY TAPE n, list
  • PUNCH FORMAT format, list
  • LOOK AT FORMAT format, list (read data without advancing to next record)
  • REWIND TAPE n
  • END OF FILE TAPE n
  • BACKSPACE RECORD OF TAPE n
  • BACKSPACE RECORD OF TAPE n, IF LOAD POINT TRANSFER TO statement
  • BACKSPACE FILE OF TAPE n
  • BACKSPACE FILE OF TAPE n, IF LOAD POINT TRANSFER TO statement
  • SET LOW DENSITY TAPE n
  • SET HIGH DENSITY TABLE n
  • REWIND TAPE n
  • UNLOAD TAPE n
  • FORMAT VARIABLE list (declaration, may include dimension information)

[edit] Functions

Internal and external functions are supported. Internal functions are compiled as part of the program in which they are used and share declarations and variables with the main program. External functions are compiled separately and do not share declarations and variables.

Function names end with a period. Singled-valued functions are called when they are referenced by name as part of an expression, while non-single valued functions (procedures) are called using the EXECUTE statement.

Functions are passed arguments by value. Arguments can be expressions, statement labels, and function names.

A one statement definition of internal functions is permitted.

Recursive functions are permitted, although the function must do some of the required saving and restoring work itself.

  • INTERNAL FUNCTION function-name.(argument-list) = expression (single statement definition)
  • INTERNAL FUNCTION function-name.(argument-list)
  • EXTERNAL FUNCTION function-name.(argument-list)
  • ENTRY TO NAME name.
  • END OF FUNCTION (last statement in a multiple line definition)
  • FUNCTION RETURN [ expression ]
  • ERROR RETURN (force an error return to a statement or to the operating system, if no error statement is given as last argument of the call)
  • SAVE RETURN
  • RESTORE DATA
  • RESTORE RETURN
  • EXECUTE procedure.(argument-list) (call a non-single valued function)

[edit] Operator definition and redefinition

One of the most interesting features in MAD is the ability to extend the language by redefining existing operators, defining new operators, or defining new data types (modes). The definitions are made using MAD declaration statements and assembly language mnemonics included following the declaration up to the END pseudo-instruction that implement the operation.

where:

Three pre-defined packages of definitions (MATRIX, DOUBLE PRECISION, and COMPLEX) are available for inclusion in MAD source programs using the INCLUDE statement.

[edit] See also

[edit] References

  1. ^ Alt, Franz (1967). Advances in Computers. Academic Press. pp. 143. ISBN 0120121042. 
  2. ^ A User's Reference Manual For The Michigan Algorithm Decoder (MAD) For the IBM 7090, Digital Computer Laboratory, Graduate College, University of Illinois, 1962, 221 pages
  3. ^ a b The Michigan Algorithm Decoder (The MAD Manual), Bruce W. Arden, Revised Edition 1966
  4. ^ a b c UNIVAC and ALGOL by George Gray in Unisys History Newsletter, Volume 6, Number 2 (June 2002), Georgia Tech
  5. ^ a b The MAD/I Manual, Bolas, Springer, and Srodawa, CONCOMP Technical Report 32, 1970, University of Michigan, Ann Arbor, 194 pages
  6. ^ MTS Volume 2: Public File Descriptions, University of Michigan Computing Center
  7. ^ a b c d GOM Manual, Don Boettner, University of Michigan Computing Center, Ann Arbor, June 1989
  8. ^ a b c Computer Languages - Principles and History, Sammet, Jean E., Englewood Cliffs, N.J., Prentice-Hall 1969, p. 205
  9. ^ In August 2010 when asked about Jean's Sammet's statement that "MAD does not resemble ALGOL 58 in any significant way", Bruce Arden wrote: "Regarding Jean Sammet, she may have conflated the two versions of IAL (58 and 60). Unlike the later version, the 58 version said nothing about what words (or language) should be used to identify conditional and transfer statements, which led for parsing reasons to words like WHENEVER. Also there were some additional features in MAD that went beyond the 58 specs."
  10. ^ Documentation and Source for Early Electronic Mail and Messaging, Tom Van Vleck
  11. ^ a b c "A Career Interview with Bernie Galler", Galler and Galler, pp 22-33, IEEE Annals of the History of Computing, 23(1) January 2001
  12. ^ Glossary of Multics acronyms and terms by Tom Van Vleck
  13. ^ An Interview with Brian Kernighan: Breeding Little Languages, by Allen Noren, 2009
  14. ^ Shneiderman, Ben; Plaisant, Catherine (2004-05-07). Designing the user interface (4th edition ed.). Addison Wesley. ISBN 978-0321197863. 
  15. ^ Technical Memos, University of Michigan Computing Center publications, 1965-1999
  16. ^ Technical Reports, University of Michigan Computing Center publications, 1965-1999
  17. ^ Topical File 1960-1986, University of Michigan Computing Center records, 1952-1996
  18. ^ MAD (Michigan Algorithm Decoder) 1960-1979, University of Michigan Computing Center records, 1952-1996

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export