Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Macro (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== In the mid-1950s, when [[assembly language]] programming was the main way to program a [[computer]], '''macro instruction''' [[Software feature|features]] were developed to reduce source code (by generating multiple assembly statements from each macro instruction) and to enforce coding conventions (e.g. specifying input/output commands in standard ways).<ref>{{cite web|title=IBM Knowledge Center|url=http://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.asma400/asmr102115.htm|website=IBM Knowledge Center|date=16 August 2013}}</ref> A macro instruction embedded in the otherwise assembly source code would be processed by a macro compiler, a [[preprocessor]] to the assembler, to replace the macro with one or more assembly instructions. The resulting code, pure assembly, would be translated to [[machine language|machine code]] by the assembler.<ref name=cisco>{{cite web|title=Assembler Language Macro Instructions|url=http://www.cisco.com/c/en/us/td/docs/ios/sw_upgrades/interlink/r2_0/api_ref/ammac.html#wp1686|website=Cisco}}</ref> Two of the earliest programming installations to develop macro languages for the IBM 705 computer were at Dow Chemical Corp. in Delaware and the Air Material Command, Ballistics Missile Logistics Office in California. Some consider macro instructions as an intermediate step between assembly language programming and the [[high-level programming languages]] that followed, such as [[FORTRAN]] and [[COBOL]]. By the late 1950s the macro language was followed by the [[Macro Assembler]]s. This was a combination of both where one program served both functions, that of a macro pre-processor and an assembler in the same package.<ref name=cisco/>{{Failed verification|date=February 2020}} Early examples are [[IBM 700/7000 series#FORTRAN assembly program|FORTRAN Assembly Program]] (FAP)<ref>{{cite book | title = FORTRAN ASSEMBLY PROGRAM (FAP) for the IBM 709/7090 | id = J28-6098-1 | year = 1961 | series = 709/7090 Data Processing System Bulletin | url = https://ibiblio.org/apollo/Documents/FortranAssemblyProgramForTheIBM7090.pdf | publisher = [[IBM]] | access-date = }}</ref> and Macro Assembly Program (IBMAP)<ref>{{cite book | title = IBM 7090/7094 Programming Systems: - Macro Assembly Program (MAP) Language | id = C28-6311-4 | year = 1964 | url = http://bitsavers.org/pdf/ibm/7090/C28-6311-4_MAP_Oct64.pdf | series = Systems Reference Library | access-date = January 12, 2025 }} </ref> on the [[IBM 709]], [[IBM 7094|7094]], [[IBM 7040|7040]] and 7044, and [[Autocoder]]<ref>{{cite manual | title = Reference Manual - IBM 7070 Series Programming Systems - Autocoder | series = IBM Systems Reference Library | id = C28-6121-0 | edition = First | year = 1961 | publisher= [[IBM Corporation ]] | url = http://bitsavers.org/pdf/ibm/7070/C28-6121-0_7070autocoder_61.pdf }}</ref> on the [[IBM 7070|7070/7072/7074]]. In 1959, Douglas E. Eastwood and [[Douglas McIlroy]] of [[Bell Labs]] introduced conditional and recursive macros into the popular [[Symbolic Assembly Program|SAP]] assembler,<ref name="CSTR99">{{cite web |url=http://cm.bell-labs.com/cm/cs/cstr/99.html |archive-url=https://archive.today/20140902215751/http://cm.bell-labs.com/cm/cs/cstr/99.html |archive-date=September 2, 2014 |title=Computing Science Technical Report No. 99 β A History of Computing Research at Bell Laboratories (1937β1975) |first1=Bernard D. |last1=Holbrook |first2=W. Stanley |last2=Brown |publisher=[[Bell Labs]] |access-date=February 2, 2020}}</ref> creating what is known as Macro SAP.<ref name="MSAP">{{cite encyclopedia |title=Macro SAP β Macro compiler modification of SAP |encyclopedia=HOPL: Online Historical Encyclopaedia of Programming Languages |url=http://hopl.murdoch.edu.au/showlanguage.prx?exp=91 |archive-url=https://web.archive.org/web/20080813125120/http://hopl.murdoch.edu.au/showlanguage.prx?exp=91 |archive-date=August 13, 2008}}</ref> McIlroy's 1960 paper was seminal in the area of extending any (including [[high-level programming language|high-level]]) programming languages through [[general-purpose macro processor|macro processors]].<ref name="Lay85">{{cite journal |last=Layzell |first=P. |author-link=Paul Layzell |year=1985 |title=The History of Macro Processors in Programming Language Extensibility |journal=The Computer Journal |volume=28 |issue=1 |pages=29β33|doi=10.1093/comjnl/28.1.29 |doi-access=free }}</ref><ref name="CSTR99"/> Macro Assemblers allowed assembly language programmers to implement their own macro-language and allowed limited portability of code between two machines running the same CPU but different operating systems, for example, early versions of [[MS-DOS]] and [[CP/M-86]]. The macro library would need to be written for each target machine but not the overall assembly language program. Note that more powerful macro assemblers allowed use of conditional assembly constructs in macro instructions that could generate different code on different machines or different operating systems, reducing the need for multiple libraries.{{citation needed|date=February 2020}} In the 1980s and early 1990s, desktop PCs were only running at a few MHz and assembly language routines were commonly used to speed up programs written in C, Fortran, Pascal and others. These languages, at the time, used different calling conventions. Macros could be used to interface routines written in assembly language to the front end of applications written in almost any language. Again, the basic assembly language code remained the same, only the macro libraries needed to be written for each target language.{{citation needed|date=February 2020}} In modern operating systems such as Unix and its derivatives, operating system access is provided through subroutines, usually provided by dynamic libraries. High-level languages such as C offer comprehensive access to operating system functions, obviating the need for assembler language programs for such functionality.{{citation needed|date=February 2020}} Moreover, [[Standard library|standard libraries]] of several newer programming languages, such as [[Go (programming language)|Go]], actively discourage the use of [[System call|syscalls]] in favor of [[Cross-platform software|platform-agnostic]] libraries as well if not necessary, to improve [[Portability (software)|portability]] and security.<ref>{{Cite web |title=syscall package - syscall - Go Packages |url=https://pkg.go.dev/syscall |access-date=2024-06-06 |website=pkg.go.dev}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)