Jump to content

MACRO-11: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
moved the rest of the material from the pdp-11 article
 
(30 intermediate revisions by 26 users not shown)
Line 1: Line 1:
{{Short description|Assembly language with macro facilities}}
{{Expand|date=October 2007}}
{{Infobox programming language
'''MACRO-11''' is an [[assembly language]] with [[Macro (computer science)|macro]] facilities for [[PDP-11]] [[minicomputers]] from [[Digital Equipment Corporation]]. It is the successor to [[PAL-11]] (Program Assembler Loader), an earlier version of the PDP-11 assembly language without macro facilities.
| name = MACRO-11
| paradigms = [[Non-structured programming|non-structured]], [[Imperative programming|imperative]]
| family = [[Assembly language]]
| designer =
| developer = [[Digital Equipment Corporation]]
| released = {{Start date and age|1980}}<!-- If known, add |mm|dd|df=yes}} -->
| typing = Untyped
| scope = [[Scope (computer science)|Lexical]]
| programming language = [[assembly language]]
| discontinued = Yes
| platform = [[PDP-11]]
| operating system = All DEC PDP-11
| influenced by = [[PAL-11R]]
| influenced = [[VAX MACRO]]
| website =
}}
'''MACRO-11''' is an [[assembly language]] with [[Macro (computer science)|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.


The MACRO-11 assembly language was designed for the [[PDP-11]] minicomputer family. It was supported on all DEC PDP-11 operating systems. PDP-11 [[Unix]] systems also include an assembler (called "as"), structurally similar to MACRO-11 but with different syntax and fewer features.
MACRO-11 was supported on all DEC PDP-11 operating systems. PDP-11 [[Unix]] systems also include an assembler (named ''[[as (Unix)|as]]''), structurally similar to MACRO-11, but with different syntax and fewer features. The MACRO-11 assembler (and programs created by it) could also run under the [[RSX-11]] compatibility mode of [[OpenVMS]] on [[VAX]].<ref name="language-1985">{{cite web |url=http://bitsavers.org/pdf/dec/vax/handbook/VMS_Language_and_Tools_Handbook_1985.pdf |title=VAX/VMS Software Language and Tools Handbook |date=1985 |website=Bitsavers.org |access-date=2020-12-31}}</ref>


==Programming example==
A complete [["Hello, World!" program]] in PDP-11 macro assembler, to run under [[RT-11]]:


<syntaxhighlight lang="nasm">
=== Programming example ===
.TITLE HELLO WORLD
[[Image:Papertape.jpg|thumb|[[Punched tape]] used for PDP-11]]
.MCALL .TTYOUT,.EXIT
A complete "[[Hello world program|Hello, world!]]" program in PDP-11 macro assembler, to run under [[RT-11]]:
HELLO:: MOV #MSG,R1 ;STARTING ADDRESS OF STRING
.TITLE HELLO WORLD
.MCALL .TTYOUT,.EXIT
1$: MOVB (R1)+,R0 ;FETCH NEXT CHARACTER
BEQ DONE ;IF ZERO, EXIT LOOP
HELLO:: MOV #MSG,R1 ;STARTING ADDRESS OF STRING
1$: MOVB (R1)+,R0 ;FETCH NEXT CHARACTER
.TTYOUT ;OTHERWISE PRINT IT
BEQ DONE ;IF ZERO, EXIT LOOP
BR 1$ ;REPEAT LOOP
DONE: .EXIT
.TTYOUT ;OTHERWISE PRINT IT
BR 1$ ;REPEAT LOOP
DONE: .EXIT
MSG: .ASCIZ /Hello, world!/
.END HELLO


MSG: .ASCIZ /Hello, world!/
If this file is <tt>HELLO.MAC</tt>, the RT-11 commands to assemble, link and run (with console output shown) are as follows:
.MACRO HELLO
.END HELLO
</syntaxhighlight>
ERRORS DETECTED: 0
The <code>.MCALL</code> pseudo-op warns the assembler that the code will be using the <code>.TTYOUT</code> and <code>.EXIT</code> macros. The <code>.TTYOUT</code> and <code>.EXIT</code> macros are defined in the standard system macro library to expand to the <code>EMT</code> instructions to call the RT-11 monitor to perform the requested functions.
.LINK HELLO
.R HELLO
Hello, world!
.


If this file is {{mono|HELLO.MAC}}, the RT-11 [[command (computing)|commands]] to assemble, link and run (with console output shown) are as follows:
(The RT-11 command prompt is "<tt>.</tt>")


<syntaxhighlight lang="nasm">
For a more complicated example of MACRO-11 code, two examples chosen at random are Kevin Murrell's [http://www.ps8computing.co.uk/PDP11/kpun_mac.htm KPUN.MAC], or Farba Research's [http://www.farbaresearch.com/examples/julian.htm JULIAN] routine. More extensive libraries of PDP-11 code can be found in the [http://www.ibiblio.org/pub/academic/computer-science/history/pdp-11/ Metalab] freeware and [http://pdp-11.trailing-edge.com/ Trailing Edge] archives.
.MACRO HELLO
ERRORS DETECTED: 0


.LINK HELLO
[http://computer-refuge.org/bitsavers/pdf/dec/pdp11/rsx11/RSX11M_V2/DEC-11-OIMRA-A-D_MACRO_75.pdf Original documentation (RSX11M_V2)]

.R HELLO
Hello, world!
.
</syntaxhighlight>

(The RT-11 command prompt is "<code>.</code>")

For a more complicated example of MACRO-11 code, two examples chosen at random are Kevin Murrell's KPUN.MAC, or Farba Research's JULIAN routine. More extensive libraries of PDP-11 code can be found in the Metalab freeware and Trailing Edge archives.<ref>[http://www.ibiblio.org/pub/academic/computer-science/history/pdp-11/ Metalab]</ref><ref>[http://pdp-11.trailing-edge.com/ Trailing Edge]</ref>

==References==
{{Reflist}}

==External links==
*[http://bitsavers.trailing-edge.com/pdf/dec/pdp11/rsx11m_s/RSX11M_V2/DEC-11-OIMRA-A-D_MACRO_75.pdf Original documentation (RSX11M_V2)]
* Michael Singer, PDP-11. Assembler Language Programming and Machine Organization, John Wiley & Sons, NY: 1980.

{{Digital Equipment Corporation}}
{{Authority control}}


[[Category:Assembly languages]]
[[Category:Assembly languages]]
[[Category:PDP-11]]
[[Category:PDP-11]]
[[Category:Digital Equipment Corporation]]
[[Category:OpenVMS software]]


{{compu-lang-stub}}
{{Prog-lang-stub}}

Latest revision as of 01:02, 29 October 2023

MACRO-11
Paradigmsnon-structured, imperative
FamilyAssembly language
DeveloperDigital Equipment Corporation
First appeared1980; 44 years ago (1980)
Typing disciplineUntyped
ScopeLexical
Implementation languageassembly language
PlatformPDP-11
OSAll DEC PDP-11
Influenced by
PAL-11R
Influenced
VAX MACRO

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.

MACRO-11 was supported on all DEC PDP-11 operating systems. PDP-11 Unix systems also include an assembler (named as), structurally similar to MACRO-11, but with different syntax and fewer features. The MACRO-11 assembler (and programs created by it) could also run under the RSX-11 compatibility mode of OpenVMS on VAX.[1]

Programming example

[edit]

A complete "Hello, World!" program in PDP-11 macro assembler, to run under RT-11:

        .TITLE  HELLO WORLD
        .MCALL  .TTYOUT,.EXIT
HELLO:: MOV     #MSG,R1  ;STARTING ADDRESS OF STRING
1$:     MOVB    (R1)+,R0 ;FETCH NEXT CHARACTER
        BEQ     DONE     ;IF ZERO, EXIT LOOP
        .TTYOUT          ;OTHERWISE PRINT IT
        BR      1$       ;REPEAT LOOP
DONE:   .EXIT

MSG:    .ASCIZ /Hello, world!/
        .END    HELLO

The .MCALL pseudo-op warns the assembler that the code will be using the .TTYOUT and .EXIT macros. The .TTYOUT and .EXIT macros are defined in the standard system macro library to expand to the EMT instructions to call the RT-11 monitor to perform the requested functions.

If this file is HELLO.MAC, the RT-11 commands to assemble, link and run (with console output shown) are as follows:

.MACRO HELLO
ERRORS DETECTED:  0

.LINK HELLO

.R HELLO
Hello, world!
.

(The RT-11 command prompt is ".")

For a more complicated example of MACRO-11 code, two examples chosen at random are Kevin Murrell's KPUN.MAC, or Farba Research's JULIAN routine. More extensive libraries of PDP-11 code can be found in the Metalab freeware and Trailing Edge archives.[2][3]

References

[edit]
  1. ^ "VAX/VMS Software Language and Tools Handbook" (PDF). Bitsavers.org. 1985. Retrieved 2020-12-31.
  2. ^ Metalab
  3. ^ Trailing Edge
[edit]