MACRO-10

Last updated

MACRO-10 is an assembly language with extensive macro facilities for DEC's PDP-10-based Mainframe computer systems, the DECsystem-10 and the DECSYSTEM-20. MACRO-10 is implemented as a two-pass assembler.

Contents

Programming examples

A simple "Hello, world!" program in MACRO-10 assembler, to run under TOPS-10, adapted from a specimen in a large collection of "Hello World" programs in various languages: [1]

TITLEHELLOWORLD; 'Hello world' in MACRO-10 for TOPS-10SEARCHUUOSYM; Make UUO symbol names availableLAB:ASCIZ/Hello,world!/; NUL-terminated ASCII string with CRLFSTART:RESET; Initialise job to clean runtime stateOUTPUT:OUTSTRLAB; Output string starting at LAB:MONRT.; Return to monitorJRSTOUTPUT; Restart at OUTPUT: if user CONTINUEs jobENDSTART; End assembly, set program start address

If this program is saved in the file HELLO.MAC, it can be assembled, linked and run like this (the TOPS-10 system prompt is the . at the start of lines):

.COMPILEHELLO.MAC/DLISTMACRO:HELLOEXIT.LOADHELLOLINK:LoadingEXIT.SAVEHELLOsaved.RUNHello,world!.

The assembly listing file generated by the /DLIST (Disk LISTing) option to the COMPILE command:

HELLOWORLDMACRO%53B(1247)17:297-Apr-:9Page1HELLOMAC7-Apr-:917:29TITLEHELLOWORLD; 'Hello world' in MACRO-10 for TOPS-10SEARCHUUOSYM; Make UUO symbol names available000000'110145154154157LAB:ASCIZ/Hello,world!000001'054040167157162000002'154144041015012/; NUL-terminated ASCII string with CRLF000003'000000000000000000004'04700000000000START:RESET; Initialise job to clean runtime state000005'05103000000000'OUTPUT:OUTSTRLAB; Output string starting at LAB:000006'04701000000012MONRT.; Return to monitor000007'25400000000005'JRSTOUTPUT; Restart at OUTPUT: if user CONTINUEs job000004'ENDSTART; End assembly, set program start addressNOERRORSDETECTEDPROGRAMBREAKIS000010CPUTIMEUSED58:25.10036PCOREUSEDHELLOWORLDMACRO%53B(1247)17:297-Apr-:9PageS-1HELLOMAC7-Apr-:917:29SYMBOLTABLELAB000000'MONRT.047040000012OUTPUT000005'OUTSTR051140000000RESET047000000000START000004'

The date ":9" is a Year 2000 problem. A more complex MACRO-10 example program, which renders one version of the 99 Bottles of Beer song, may be examined at the "99 Bottles of Beer" web site. [2]

For larger bodies of code, much of the MACRO-10 code for the TOPS-10 and TOPS-20 systems is available in the Trailing Edge PDP-10 tape archives. [3]

Related Research Articles

<span class="mw-page-title-main">"Hello, World!" program</span> Traditional beginners computer program

A "Hello, World!" program is generally a computer program that ignores any input, and outputs or displays a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustrate a language's basic syntax. "Hello, World!" programs are often the first a student learns to write in a given language, and they can also be used as a sanity check to ensure computer software intended to compile or run source code is correctly installed, and that its operator understands how to use it.

<span class="mw-page-title-main">Macro (computer science)</span> Rule for substituting a set input with a set output

In computer programming, a macro is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output may be a sequence of lexical tokens or characters, or a syntax tree. Character macros are supported in software applications to make it easy to invoke common command sequences. Token and tree macros are supported in some programming languages to enable code reuse or to extend the language, sometimes for domain-specific languages.

<span class="mw-page-title-main">PDP-10</span> 36-bit computer by Digital (1966–1983)

Digital Equipment Corporation (DEC)'s PDP-10, later marketed as the DECsystem-10, is a mainframe computer family manufactured beginning in 1966 and discontinued in 1983. 1970s models and beyond were marketed under the DECsystem-10 name, especially as the TOPS-10 operating system became widely used.

<span class="mw-page-title-main">DECSYSTEM-20</span> Type of mainframe computer

The DECSYSTEM-20 was a 36-bit Digital Equipment Corporation PDP-10 mainframe computer running the TOPS-20 operating system.

<span class="mw-page-title-main">Programmed Data Processor</span> Name used for several lines of minicomputers

Programmed Data Processor (PDP), referred to by some customers, media and authors as "Programmable Data Processor," is a term used by the Digital Equipment Corporation from 1957 to 1990 for several lines of minicomputers.

<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.

SNOBOL is a series of programming languages developed between 1962 and 1967 at AT&T Bell Laboratories by David J. Farber, Ralph E. Griswold and Ivan P. Polonsky, culminating in SNOBOL4. It was one of a number of text-string-oriented languages developed during the 1950s and 1960s; others included COMIT and TRAC.

TECO, short for Text Editor & Corrector, is both a character-oriented text editor and a programming language, that was developed in 1962 for use on Digital Equipment Corporation computers, and has since become available on PCs and Unix. Dan Murphy developed TECO while a student at the Massachusetts Institute of Technology (MIT).

<span class="mw-page-title-main">Netwide Assembler</span> Assembler for the Intel x86 architecture

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. It is considered one of the most popular assemblers for Linux and x86 chips.

<span class="mw-page-title-main">TOPS-20</span>

The TOPS-20 operating system by Digital Equipment Corporation (DEC) is a proprietary OS used on some of DEC's 36-bit mainframe computers. The Hardware Reference Manual was described as for "DECsystem-10/DECSYSTEM-20 Processor".

Peripheral Interchange Program (PIP) was a utility to transfer files on and between devices on Digital Equipment Corporation's computers. It was first implemented on the PDP-6 architecture by Harrison "Dit" Morse early in the 1960s. It was subsequently implemented for DEC's operating systems for PDP-10, PDP-11, and PDP-8 architectures. In the 1970s and 1980s Digital Research implemented PIP on CP/M and MP/M.

TOPS-10 System is a discontinued operating system from Digital Equipment Corporation (DEC) for the PDP-10 mainframe computer family. Launched in 1967, TOPS-10 evolved from the earlier "Monitor" software for the PDP-6 and PDP-10 computers; this was renamed to TOPS-10 in 1970.

Edinburgh IMP is a development of Atlas Autocode, initially developed around 1966-1969 at the University of Edinburgh, Scotland. It is a general-purpose programming language which was used heavily for systems programming.

In mathematics and in computer programming, a variadic function is a function of indefinite arity, i.e., one which accepts a variable number of arguments. Support for variadic functions differs widely among programming languages.

RADIX 50 or RAD50, is an uppercase-only character encoding created by Digital Equipment Corporation (DEC) for use on their DECsystem, PDP, and VAX computers.

MACRO-11 is an assembly language with macro facilities, designed for PDP-11 minicomputer family from Digital Equipment Corporation (DEC). It is the successor to Program Assembler Loader (PAL-11R), an earlier version of the PDP-11 assembly language without macro facilities.

od is a command on various operating systems for displaying ("dumping") data in various human-readable output formats. The name is an acronym for "octal dump" since it defaults to printing in the octal data format.

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 architecture in the 1980s.

Charm is a computer programming language devised in the early 1990s with similarities to the RTL/2, Pascal and C languages in addition to containing some unique features of its own. The Charm language is defined by a context-free grammar amenable to being processed by recursive descent parser as described in seminal books on compiler design.

Time Sharing Limited (TSL) was the United Kingdom's first time sharing computer services company.

References

  1. Wolfram Rösler,"The Hello World Collection". Retrieved on 16 November 2016.
  2. "99 Bottles of Beer" Retrieved on 10 April 2009.
  3. Trailing Edge PDP-10 software archive