IBM Basic assembly language and successors: Difference between revisions

Content deleted Content added
add assembler coding form
External links: HLASM URLs
 
(40 intermediate revisions by 14 users not shown)
Line 69:
 
==General characteristics==
As it is an [[assembly language]], BAL uses the native [[instruction set]] of the IBM mainframe architecture on which it runs, [[IBM System/360|System/360]]., just as the successors to BAL use the native instruction sets of the IBM mainframe architectures on which they run, including [[IBM System/360|System/360]], [[IBM System/370|System/370]], [[IBM System/370-XA|System/370-XA]], [[IBM ESA/370|ESA/370]], [[IBM ESA/390|ESA/390]], and [[z/Architecture]].
 
The successors to BAL use the native instruction sets of the IBM mainframe architectures on which they run, including [[IBM System/360|System/360]], [[IBM System/370|System/370]], [[IBM System/370-XA|System/370-XA]], [[IBM ESA/370|ESA/370]], [[IBM ESA/390|ESA/390]], and [[z/Architecture]].
 
The simplicity of machine instructions means that the [[source code]] of a program written in assembler will usually be much longer than an equivalent program in, say, [[COBOL]] or [[Fortran]]. In the past, the speed of hand-coded assembler programs was often felt to make up for this drawback, but with the advent of optimizing compilers, [[C (programming language)|C]] for the mainframe, and other advances, assembler has lost much of its appeal. IBM continues to upgrade the assembler, however, and it is still used when the need for speed or very fine control is paramount. However, all of the IBM successors to BAL have included a sophisticated macro facility that allows writing much more compact source code.
 
Another reason to use assembler is that not all operating system functions can be accessed in high level languages. The application program interfaces of IBM's mainframe operating systems is defined as a set of assembly language "macro" instructions, that typically invoke [[Supervisor Call instruction|Supervisor Call]] (<code>SVC</code>) [e.g., on z/OS] or Diagnose (<code>DIAG</code>) [on, e.g., z/VM] instructions to invoke operating system routines. It is possible to use operating system services from programs written in high-level languages by use of assembler subroutines.
 
==Assembler statement format==
[[Image:IBM System 360 Assembler Coding Form.jpg|thumb|right|Some programmers used an assembler coding form for the IBM 360 assemblerassembly languages and itstheir successors]]
[[Image:IBM keypunch deck and program listing for Assembly language student program at New York University 1979.jpg|thumb|right|Keypunch cards and a printed assembly listing were common during IBM 370 assembly language use in the 1970s]]
The format of assembler language statements reflects the layout of an 80-column punched card, though successive versions have relaxed most of the restrictions.
Line 96 ⟶ 94:
 
===Assembler instructions===
Assembler instructions, sometimes termed [[Assembly language#Assembly directives|directives]], pseudo operations or pseudoops on other systems, are requests to the assembler to perform various operations during the code generation process. For instance, <code>CSECT</code> means "start a section of code here"; <code>DSECT</code> provides data definitions for a structure, but generates no code; <code>DC</code> defines a constant to be placed in the object code.
 
One of the more important assembler instructions is <code>USING</code>, which supports the truncatedbase-displacement addressing of the S/360 architecture. It guides the assembler in determining what base register and offset it should use for a relative address. In BAL, it was limited to the form
 
<syntaxhighlight lang="text">
USING base,reg-1,...,reg-n
</syntaxhighlight>
Machine instruction addresses on S/360 specify a ''displacement'' (0–4095 bytes) from the value in a ''base register''; while later versions of the architecture added relative-address formats, the older formats are still used by many instructions. <code>USING</code> allows the programmer to tell the assembler that the specified base registers are assumed to contain the address of "base", base+4096 (if multiple registers are specified), etc. This only provides a shortcut for the programmer, who otherwise would have to specify the base register in each instruction. Programmers are still responsible for actually loading the address of "base" into the register before writing code that depends on this value.
 
The related <code>DROP</code> assembler instruction nullifies a previous <code>USING</code>.
 
===Machine instructions (mnemonic)===
Line 130 ⟶ 131:
</syntaxhighlight>
 
Generally accepted standards, although by no means mandatory, include the identification of general purpose registers with mnemonics. Unlike assemblers for some other systems, such as [[X86 assembly language]], register mnemonics are not reserved symbols but are defined through <code>EQU</code> statements elsewhere in the program. This improves readability of assembler language programs and provides a cross-reference of register usage. Thus typically you may see the following in an assembler program:
 
<syntaxhighlight lang="text">
Line 138 ⟶ 139:
</syntaxhighlight>
 
Some notable [[w:nl:Instructieset van IBM 360|instruction]] mnemonics are <code title="Branch And Link Register">BALR</code>{{efn|Most uses of '''BALR''' have been replaced by <code title{{=}}"Branch And Save Register">BASR</code> and similar instructions.}} for a call storing the return address and condition code in a register, <code title="SuperVisor Call">[[Supervisor Call instruction|SVC]]</code>,{{efn|Many uses of <code title{{=}}"SuperVisor Call">[[Supervisor Call instruction|SVC]]</code> have been replaced by a <code title{{=}}"Program Call">PC</code> instruction.}} <code title="Diagnose">DIAG</code>,{{efn|VM repurposes <code title{{=}}"Diagnose">DIAG</code> as an <code title{{=}}"Hypervisor Call">[[Hypervisor|HVC]]</code> instruction.}} and <code title="Zero and Add Packed Decimal">ZAP</code>.<ref name="opl_bobm">{{cite web|url=http://www.bixoft.nl/english/opl_bobm.htm|title=HLASM - List of all Opcodes, Extended Mnemonics and Function Codes, Sorted by Mnemonic|accessdate=January 14, 2013}}</ref>
<!-- Couldn't use <code> within {{efn}}. -->
 
System/360 machine instructions are one, two, or three [[Word (computer architecture)#siizeSize families|halfwords]] in length (two to 6 bytes). Originally there were four instruction formats, designated by the first two bits of the operation code field; [[z/Architecture]] added additional formats.
 
===Macros and conditional assembly===
Line 147 ⟶ 148:
 
===Operating system macros===
Most programs will require services from the [[operating system]], and the OS provides standard macros for requesting those services. These are analogous to [[Unix]] [[system call]]s. For instance, in [[MVS]] (later z/OS), <code>STORAGE</code> (with the <code>OBTAIN</code> parameter) dynamically allocates a block of memory, and <code>GET</code> retrieves the next logical record from a file.
 
These macros are operating-system-dependent; unlike several higher-level languages, IBM mainframe assembly languages don't provide operating-system-independent statements or libraries to allocate memory, perform I/O operations, and so forth, and different IBM mainframe operating systems are not compatible at the system service level. For example, writing a sequential file would be coded differently in z/OS and in z/VSE.
Line 171 ⟶ 172:
</syntaxhighlight>
 
The following is the ubiquitous [["Hello, world]]World!" program]], and would, executing under an IBM operating system such as [[OS/VS1]] or [[MVS]], display the words 'Hello, World!' on the operator's console:
 
<syntaxhighlight lang="text">
Line 184 ⟶ 185:
LR 13,15 Set R13 to address of new save area
* -end of housekeeping (similar for most programs) -
WTO 'Hello, World!' Write To Operator (Operating System macro)
*
L 13,4(13) restore address to caller-provided save area
Line 212 ⟶ 213:
[[Image:Program listing heading page for Assembler G as run on IBM 370 at New York University in 1979.jpg|thumb|right|Batch job printout showing identification page for Assembler G]]
With the exception of the assemblers for the [[IBM System/360 Model 20]], the IBM assemblers were largely upward-compatible. The differences were mainly in the complexity of expressions allowed and in macro processing. [[OS/360 and successors|OS/360]] assemblers were originally designated according to their memory requirements.
 
===7090/7094 Support Package assembler===
This cross-assembler runs on a [[IBM 7090|7090 or 7094]] system and was used while System/360 was in development.<ref name=BAL /><ref>{{cite manual
| title = IBM 7090/7094 Support Package for IBM System/360
| id = C28-6501-2
| date = November 1964
| url = http://bitsavers.org/pdf/ibm/7090/C28-6501-2_7090_SupportForSys360_Nov64.pdf
| series = IBM Systems Reference Library
| publisher = IBM Corporation
| access-date = April 5, 2022
}}
</ref>
 
===Basic Programming Support assembler===
Line 235 ⟶ 224:
| access-date = April 5, 2022
}}
</ref>{{rp|pp.pages=59–61}}
 
===Basic Operating System assembler===
Line 247 ⟶ 236:
| access-date = April 5, 2022
}}
</ref>{{rp|pp.pages=7–8}}
 
===Assembler D===
Assembler D was the [[DOS/360 and successors|DOS/360]] assembler for machines with a memory size of 16&nbsp;KB. It came in two versions: A 10&nbsp;KB variant for machines with the minimum 16&nbsp;KB memory, and a 14&nbsp;KB variant for machines with 24&nbsp;KB. An F-level assembler was also available for DOS machines with 64&nbsp;KB or more. D assemblers offered nearly all the features of higher versions.<ref name=ASMD>{{cite book|last=IBM Corporation|title=IBM System/360 Disk and Tape Operating Systems Assembler Language|year=1970|url=http://bitsavers.trailing-edge.com/pdf/ibm/360/dos/asm/GC24-3414-7_Disk_and_Tape_Operating_Systems_Assembler_Language_Aug70.pdf|access-date=2024-09-19}}</ref>{{rp|p.page=7}}
 
===Assembler E and F===
Assembler E was designed to run on an OS/360 system with a minimum of 32&nbsp;KB of main storage, with the assembler itself requiring 15&nbsp;KB.<ref>{{cite book|title=IBM System/360 Operating System Assembler (32K) Program Logic Manual|year=1966|url=http://bitsavers.trailing-edge.com/pdf/ibm/360/asm/Y26-3598-0_32k_asmPLM_1966.pdf|publisher=IBM|id=Y26-3598-0}}</ref>{{rp|p.page=2}} Assembler F can run under either DOS/360 or OS/360 on a system with a 64&nbsp;KB memory, with the assembler requiring 44&nbsp;KB.<ref>{{cite book|title=IBM System/360 Disk Operating System Assembler [F] Program Logic|year=1968|url=http://bitsavers.trailing-edge.com/pdf/ibm/360/asm/Y26-3716-0_asm%28f%29_plm_Mar68.pdf|publisher=IBM|id=Y26-3716-0}}</ref><ref>{{cite book|title=IBM System/360 Operating System Assembler (F) Program Logic|year=1971|url=http://bitsavers.trailing-edge.com/pdf/ibm/360/asm/GY26-3700-2_asm%28f%29_plm_Jun71.pdf|publisher=IBM|id=GY26-3700-2}}</ref><ref>{{cite book|title=OS Assembler Language, OS Release 21|year=1974|url=http://www.bitsavers.org/pdf/ibm/360/asm/GC28-6514-9_OS_Assembler_Rel21_Jan74.pdf|publisher=IBM|id=GC28-6514-9}}</ref> These assemblers are a standard part of OS/360; the version that was generated was specified at [[System Generation (OS)|system generation]] (SYSGEN).
 
===Model 44 Programming System Assembler===
"With certain exceptions, the [[IBM System/360 Model 44]] Programming System Assembler Language is a selected subset of the languages available in the IBM System/360 programming support." Most significantly the Model 44 assembler lacked support for macros and continuation statements. On the other hand it had a number of features not found in other System/360 assemblers—notably instructions to update a [[card image]] source dataset, named common, and implicit definition of <code>SETA</code> assembler variables.<ref>{{cite book |last1=IBM Corporation |title=IBM System/360 Model 44 Programming System Assembler Language |date=1966 |page=73 |url=http://bitsavers.org/pdf/ibm/360/model44/C28-6811-1_Model_44_Programming_System_Assembler_Language_1966.pdf |accessdate=July 2, 2019}}</ref>
 
===Assembler G===
"Assembler G" is a set of modifications made to Assembler F in the 1970s by the [[University of Waterloo]] (Assembler F was/is open source). Enhancements are mostly in better handling of input/output and improved buffering which speed up assemblies considerably.<ref>{{cite web|last=Stanford Linear Accelerator Center|title=GENERALIZED IBM SYSTEM 360 SOFTWARE MEASUREMENT (SLAC-PUB-715)|url=http://www.slac.stanford.edu/cgi-wrap/getdoc/slac-pub-0715.pdf|accessdate=October 8, 2012}}</ref> "Assembler G" was never an IBM product.
 
===Assembler H===
Assembler H runs on [[OS/360 and successors]]; it was faster and more powerful than Assembler F, but the macro language was not fully compatible.
 
Assembler H Version 2 was announced in 1981 and includes support for Extended Architecture (XA), including the <code>AMODE</code> and <code>RMODE</code> directives.<ref>{{cite book|last=IBM Corporation|title=MVS/Extended Architecture Conversion Notebook|year=1984|url=http://www.bitsavers.trailing-edge.comorg/pdf/ibm/370/MVS_XA/GC28-1143-2_MVS_EA_Conversion_Notebook_May842_MVS-XA_Conversion_Notebook_May84.pdf}}</ref>{{rp|p.3–28page=3{{hyp}}28}} It was withdrawn from marketing in 1994 and support ended in 1995. It was replaced by High Level Assembler.<ref>{{cite web|last=IBM Corporation|title=5668-962 IBM Assembler H Version 2 Release 1.0|website=[[IBM]] |date=20 December 1996|url=httphttps://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=dd&subtype=sm&appname=ShopzSeries&htmlfid=897/ENUS5668-962|accessdate=October 8, 2012|archive-url=https://web.archive.org/web/20210924192756/https://www.ibm.com/common/ssi/cgi-bin/ssialias?infotype=dd&subtype=sm&appname=ShopzSeries&htmlfid=897/ENUS5668-962|archive-date=24 September 2021|url-status=dead}}</ref>
 
===Assembler XF===
Assembler XF is a mostly compatible upgrade of Assembler F that includes the new System/370 architecture instructions. This version provides a common assembler for OS/VS, DOS/VS and VM systems. Other changes include relaxing restrictions on expressions and macro processing. Assembler XF requires a minimum partition/region size of 64&nbsp;KB (virtual). Recommended size is 128&nbsp;KB.<ref>{{cite book|last=IBM Corporation|title=OS/VS Assembler Programmer's Guide|year=1973|url=http://bitsavers.trailing-edge.comorg/pdf/ibm/370/OS_VS/assembler/GC33-4021-1_OS_VS_Assembler_Programmers_Guide_May73.pdf|access-date=2024-09-19}}</ref>{{rp|p.page=73}}
 
===High Level Assembler===
'''High Level Assembler''' or '''HLASM''' was released in June 1992 replacing IBM's Assembler H Version 2.<ref>{{cite web|last=IBM Corporation|title=IBM High Level Assembler and Toolkit Feature - Release History|website=[[IBM]] |date=19 October 2018 |url=httphttps://www-01.ibm.com/softwaresupport/awdtools/hlasmpages/ibm-high-level-assembler-and-toolkit-feature-release-history.html|accessdateaccess-date=OctoberJanuary 2119, 20122025}}</ref><ref name="hlasm-announcement-letter">{{cite web|lastpublisher=IBM Corporation|titletype=Announcement Letter letter|id=292-244: |title=IBM HIGHHigh LEVELLevel ASSEMBLERAssembler/MVS & VM & VSE|date=5 May 1992 |url=httphttps://www-01.ibm.com/commondocs/ssien/cgi-binannouncements/ssialias?infotype=an&subtype=ca&htmlfid=897archive/ENUS292-244&language=enus|accessdateaccess-date=OctoberJanuary 2119, 20122025}}</ref> It was the default translator for System/370 and System/390, and supported the MVS, VSE, and VM operating systems. As of 2023 it is [[IBM]]'s current [[Assembly language|assembler]] programming language for its [[z/OS]], [[z/VSE]], [[z/VM]] and [[z/TPF]] [[operating system]]s on [[z/Architecture]] [[mainframe computer|mainframe]] [[computers]]. Release 6 and later also run on [[Linux]], and generate [[Executable and Linkable Format|ELF]] or [[GOFF]] object files (this environment is sometimes referred to as [[Linux on IBM Z]]).<ref>{{cite book|last=IBM Corporation|title=High Level Assembler for Linux on zSeries User's Guide|year=2008|url=httphttps://publibfp.dhe.ibm.com/epubs/pdf/asml1020.pdf|access-date=2025-07-23}}</ref> While working at IBM, John Robert Ehrman<!-- 1935-2018 https://web.archive.org/web/20221015170120/https://oac.cdlib.org/findaid/ark:/13030/c8xk8mnr/ https://web.archive.org/web/20221015172646/https://www.forevermissed.com/john-ehrman/about https://www.linkedin.com/in/john-ehrman-8794b26b --> created and was the lead developer for HLASM{{efn|HLASM followed a SHARE requirement to incorporate Greg Mushial's enhancements<ref>{{citation
 
'''High Level Assembler''' or '''HLASM''' was released in June 1992 replacing IBM's Assembler H Version 2.<ref>{{cite web|last=IBM Corporation|title=IBM High Level Assembler and Toolkit Feature - Release History|url=http://www-01.ibm.com/software/awdtools/hlasm/history.html|accessdate=October 21, 2012}}</ref><ref>{{cite web|last=IBM Corporation|title=Announcement Letter 292-244: IBM HIGH LEVEL ASSEMBLER/MVS & VM & VSE|date=5 May 1992 |url=http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=an&subtype=ca&htmlfid=897/ENUS292-244&language=enus|accessdate=October 21, 2012}}</ref> It was the default translator for System/370 and System/390, and supported the MVS, VSE, and VM operating systems. As of 2023 it is [[IBM]]'s current [[Assembly language|assembler]] programming language for its [[z/OS]], [[z/VSE]], [[z/VM]] and [[z/TPF]] [[operating system]]s on [[z/Architecture]] [[mainframe computer|mainframe]] [[computers]]. Release 6 and later also run on [[Linux]], and generate [[Executable and Linkable Format|ELF]] or [[GOFF]] object files (this environment is sometimes referred to as [[Linux on IBM Z]]).<ref>{{cite book|last=IBM Corporation|title=High Level Assembler for Linux on zSeries User's Guide|year=2008|url=http://publibfp.dhe.ibm.com/epubs/pdf/asml1020.pdf}}</ref> While working at IBM, John Robert Ehrman<!-- 1935-2018 https://web.archive.org/web/20221015170120/https://oac.cdlib.org/findaid/ark:/13030/c8xk8mnr/ https://web.archive.org/web/20221015172646/https://www.forevermissed.com/john-ehrman/about https://www.linkedin.com/in/john-ehrman-8794b26b --> created and was the lead developer for HLASM{{efn|HLASM followed a SHARE requirement to incorporate Greg Mushial's enhancements<ref>{{citation
| title = Module 24: SLAC Enhancements to and Beautifications of the IBM H-Level Assembler for Version 2.8
| author = Greg Mushial
Line 281 ⟶ 263:
</ref> to Assembler H into the supported product.}} and is considered the "father of high level assembler".<ref>{{cite web |title=Guide to the John R. Ehrman collection |id=X5621.2010 |publisher=[[Online Archive of California]] |url=https://oac.cdlib.org/findaid/ark:/13030/c8xk8mnr/ |access-date=2022-10-15 |url-status=live |archive-url=https://web.archive.org/web/20221015170120/https://oac.cdlib.org/findaid/ark:/13030/c8xk8mnr/ |archive-date=2022-10-15}} [https://web.archive.org/web/20220419202358/http://pdf.oac.cdlib.org/pdf/camvchm/102733967-Ehrman.pdf]</ref>
 
Despite the name, HLASM on its own does not have many of the features normally associated with a [[high-level assembler]]. The name may come from the additional macro language capabilities, such as the ability to write user-defined functions. The assembler is mostly similar to Assembler H and Assembler(XF), incorporating the [[SLAC]] (Stanford Linear Accelerator) modifications. Among features added were an indication of <code>CSECT</code>/<code>DSECT</code> for ___location counter, dependent{{efn|A dependent <code>USING</code> is one that specifies a relocatable expression instead of a list of registers:
<syntaxhighlight lang="text">
USING IHADCB,SYSPRINT
Line 288 ⟶ 270:
...
</syntaxhighlight>
}} and labelled{{efn|A labelled <code>USING</code> is one that only affects instructions that explicitly refer to it by qualifying an expression with a label:
<syntaxhighlight lang="text">
LA R4,SYSIN
Line 300 ⟶ 282:
...
</syntaxhighlight>
}} <code>USING</code> statements, a list of <code>USING</code> statements currently active, an indication of whether a variable is read or written in the cross-reference, and allowing mixed-case symbol names.<ref>{{cite webname="hlasm-announcement-letter" />
</ref> The ''<code>RSECT</code>'' directive (Read-only Control Section) allows the assembler to check reentrancy on a per-section basis. <code>RSECT</code> was previously "undocumented and inconsistently implemented in Assembler H."<ref>{{cite book|last=IBM Corporation|title=IBM High Level Assembler for MVS & VM & VSE Release 2 Presentation Guide|year=1995|url=http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf|url-status=dead|archiveurl=https://web.archive.org/web/20160123064644/http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf|archivedate=2016-01-23}}</ref>{{RP|p.43}}
| title = IBM HIGH LEVEL ASSEMBLER/MVS & VM & VSE
| title = IBM High Level Assembler for MVS & VM & VSE Release 2 Presentation Guide
| id = 292-244
| dateid = May 5, 1992= SG24-3910-01
| id series = 292-244Redbooks
| url = http://www.ibm.com/common/ssi/cgi-bin/ssialias?infotype=an&subtype=ca&htmlfid=897/ENUS292-244&language=enus
| workdate = AnnouncementDecember letters1995
| url = http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf
| publisher = IBM Corporation
| url-status = dead
| accessdate = October 8, 2012
| archive-url = https://web.archive.org/web/20160123064644/http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf
| archive-date = 2016-01-23
| publisher = IBM Corporation[[IBM]]
| access-date = September 29, 2023
}}
</ref>{{rp|page=41}}
</ref> The ''<code>RSECT</code>'' directive (Read-only Control Section) allows the assembler to check reentrancy on a per-section basis. <code>RSECT</code> was previously "undocumented and inconsistently implemented in Assembler H."<ref>{{cite book|last=IBM Corporation|title=IBM High Level Assembler for MVS & VM & VSE Release 2 Presentation Guide|year=1995|url=http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf|url-status=dead|archiveurl=https://web.archive.org/web/20160123064644/http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf|archivedate=2016-01-23}}</ref>{{RP|p.43}}
 
====High Level Assembler Toolkit====
Line 326 ⟶ 312:
 
==Specialized versions==
 
===7090/7094 Support Package assembler===
The IBM 7090/7094 Support Package, known as SUPPAK, "consists of three programs designed to permit programs written for a System 360 to be assembled, tested, and executed on an IBM 709, 7090, 7094, or 7094&nbsp;II."
 
This cross-assembler runs on a [[IBM 7090|7090 or 7094]] system and was used while System/360 was in development.<ref name=BAL /><ref>{{cite manual
| title = IBM 7090/7094 Support Package for IBM System/360
| id = C28-6501-2
| date = November 1964
| url = http://bitsavers.org/pdf/ibm/7090/C28-6501-2_7090_SupportForSys360_Nov64.pdf
| series = IBM Systems Reference Library
| publisher = IBM Corporation
| access-date = April 5, 2022
}}
</ref> This assembler supports six-bit [[BCD (character encoding)|BCD]] character set as well as eight-bit [[EBCDIC]].
 
===IBM System/360 Model 20 assemblers===
IBM supplied two assemblers for the Model 20: the Model 20 Basic Assembler, and the Model 20 DPS/TPS Assembler. Both supported only instructions available on the Model 20, including unique instructions <code>CIO</code>, <code>TIO</code>, <code>XIOB</code>, <code>SPSW</code>, <code>BAS</code>, <code>BASR</code>, and <code>HPR</code>.<ref name="M20">{{cite book |last1=IBM Corporation |title=IBM System/360 Model 20 Disk and Tape Programming Systems Assembler Language |date=April 1970 |url=https://bitsavers.org/pdf/ibm/360/model20/GC24-9002-5_360-20asm_Apr70.pdf |access-date=October 2, 2023}}</ref>{{rp|page=110}} The Basic Assembler is a slightly more restricted version of System/360 Basic Assembler;<ref name="M20CPS">{{cite book |last1=IBM Corporation |title=IBM System/360 Model 20 Card Programming Support Basic Assembler Language |date=May 1969 |url=http://bitsavers.org/pdf/ibm/360/model20/GC26-3602-5_360_20_Card_Programming_Support_Basic_Assembler_Language_Jan71.pdf |access-date=October 2, 2023}}</ref> notably, symbols are restricted to four characters in length. This version is capable of running on a system with 4&nbsp;KB memory, and macro support is limited to [[IOCS]] macros. The card versions are two-pass assemblers that only support card input/output. The tape-resident versions are one-pass, using [[magnetic tape]] for intermediate storage. Programs assembled with the CPS Assembler can address a maximum of 16&nbsp;KB.<ref name=M20CPS />{{rp|pages=7-8}}
 
The DPS/TPS assembler is a somewhat restricted version of System/360 BPS/BOS Assembler.<ref name=M20 />{{rp|pages=132–134}}
 
===IBM System/360 Model 44 PS assembler===
The [[IBM System/360 Model 44]] Programming System Assembler processes a language that is a "selected subset" of OS/360 and DOS/360 assembler language.
The [[IBM System/360 Model 44]] Programming System Assembler processes a language that is a "selected subset" of OS/360 and DOS/360 assembler language. It has no support for storage-to-storage (SS) instructions or the ''convert to binary'' (<code>CVB</code>), ''convert to decimal'' (<code>CVD</code>), ''read direct'' (<code>RDD</code>) and ''write direct'' (<code>WRD</code>) instructions.<ref name=M44>{{cite book|last=IBM Corporation|title=IBM System/360 Model 44 Programming System Assembler Language|year=1966|url=http://bitsavers.trailing-edge.com/pdf/ibm/360/model44/c28-6811-1_360_44_Asm.pdf}}</ref> It does include four instructions unique to the Model 44: ''Change Priority Mask'' (<code>CHPM</code>), ''Load PSW Special'' (<code>LPSX</code>), ''Read Direct Word'' (<code>RDDW</code>), and ''Write Direct Word'' (<code>WRDW</code>). It also includes directives to update the source program, a function performed by utility programs in other systems (<code>SKPTO</code>, <code>REWND</code>, <code>NUM</code>, <code>OMIT</code> and <code>ENDUP</code>). It provides ''named common'' and implicitly defined <code>&SETA</code> symbols, but has some restrictions as well.<ref name=M44 />{{rp|pp.53,73}}
 
"With certain exceptions, the [[IBM System/360 Model 44]] Programming System Assembler Language is a selected subset of the languages available in the IBM System/360 programming support." Most significantly the Model 44 assembler lackedlacks support for macros and continuation statements. On the other hand it hadhas a number of features not found in other System/360 assemblers—notably instructions to update a [[card image]] source dataset, named common, and implicit definition of <code>SETA</code> assembler variables.<ref>{{cite book |last1=IBM Corporation |title=IBM System/360 Model 44 Programming System Assembler Language |date=1966 |page=73 |url=http://bitsavers.org/pdf/ibm/360/model44/C28-6811-1_Model_44_Programming_System_Assembler_Language_1966.pdf |accessdate=July 2, 2019}}</ref>
 
The [[IBM System/360 Model 44]] Programming System Assembler processes a language that is a "selected subset" of OS/360 and DOS/360 assembler language. It has no support for storage-to-storage (SS) instructions or the ''convert to binary'' (<code>CVB</code>), ''convert to decimal'' (<code>CVD</code>), ''read direct'' (<code>RDD</code>) and ''write direct'' (<code>WRD</code>) instructions.<ref name=M44>{{cite book|last=IBM Corporation|title=IBM System/360 Model 44 Programming System Assembler Language|year=1966|url=http://bitsavers.trailing-edge.comorg/pdf/ibm/360/model44/c28C28-6811-1_360_44_Asm1_Model_44_Programming_System_Assembler_Language_1966.pdf|access-date=2024-09-19}}</ref> It does include four instructions unique to the Model 44: ''Change Priority Mask'' (<code>CHPM</code>), ''Load PSW Special'' (<code>LPSX</code>), ''Read Direct Word'' (<code>RDDW</code>), and ''Write Direct Word'' (<code>WRDW</code>). It also includes directives to update the source program, a function performed by utility programs in other systems (<code>SKPTO</code>, <code>REWND</code>, <code>NUM</code>, <code>OMIT</code> and <code>ENDUP</code>). It provides ''named common'' and implicitly defined <code>&SETA</code> symbols, but has some restrictions as well.<ref name=M44 />{{rp|pp.53,73}}
 
It also includes directives to update the source program, a function performed by utility programs in other systems (<code>SKPTO</code>, <code>REWND</code>, <code>NUM</code>, <code>OMIT</code> and <code>ENDUP</code>).<ref name=M44 />{{rp|pages=53,73}}
 
===IBM System/360 TSS assembler===
The assembler for the [[TSS/360|System/360 Model 67 Time Sharing System]] has a number of differences in directives to support unique TSS features. The <code>''PSECT''</code> directive generates a ''Prototype Control Section'' containing relocatable address constants and modifiable data used by the program.<ref>{{cite book|last=IBM Corporation|title=IBM Time Sharing System Assembler Programmer's Guide|year=1976|url=http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/360/tss/GC28-2032-6_Time_Sharing_System_Assembler_Programmers_Guide_Apr76.pdf}}</ref>{{rp|p.page=143}}
 
===Assembler G===
"Assembler G" is a set of modifications made to Assembler F in the 1970s by the [[University of Waterloo]] (Assembler F was/is open source). Enhancements are mostly in better handling of input/output and improved buffering which speed up assemblies considerably.<ref>{{cite web|last=Stanford Linear Accelerator Center|title=GENERALIZED IBM SYSTEM 360 SOFTWARE MEASUREMENT (SLAC-PUB-715)|url=http://www.slac.stanford.edu/cgi-wrap/getdoc/slac-pub-0715.pdf|accessdate=October 8, 2012}}</ref> "Assembler G" was never an IBM product.
 
==Non-IBM assemblers==
Line 345 ⟶ 359:
* [[GNU Assembler]] (gas) is part of the [[GNU Compiler Collection]] (gcc) for [[Linux on IBM Z|Linux on OS/390 and IBM Z]]. This assembler has a unique syntax that is incompatible with other assemblers for IBM architectures.
 
==TriviaImportance==
Originally all System/360 operating systems were written in assembler language, and all system interfaces were defined by macro definitions. Access from high-level languages (HLLs) was restricted to what that language supplied, and other system calls had to be coded as assembler subroutines called from HLL programs. Also, IBM allowed customization of OS features by an installation through what were known as ''Exits''—user-supplied routines that could extend or alter normal OS functions. These exits were required to be coded in assembler language. Later, IBM recoded OS/360 in a systems programming language, [[PL/S]], but, except for a short trial, decided not to release the PL/S compiler to users. As a result of these factors, assembler language saw significant use on IBM systems for many years.
BAL is also the mnemonic of the "Branch And Link" [[w:nl:Instructieset van IBM 360|instruction]].<ref name="opl_bobm">{{cite web|url=http://www.bixoft.nl/english/opl_bobm.htm|title=HLASM - List of all Opcodes, Extended Mnemonics and Function Codes, Sorted by Mnemonic|accessdate=January 14, 2013}}</ref>
 
==See also==
Line 359 ⟶ 373:
==References==
{{Reflist|30em}}
;Additional references
* Rudd, Anthony. An Illustrated Guide for z/Architecture Assembler Programmers. Create Space (2012).
 
==External links==
{{Wikibooks|360 Assembly}}
 
* [https://www.ibm.com/docs/en/hla-and-tf/1.6.0?topic=generalpdf-information IBM Highformat-documentation LevelPDF Assemblerformat manualdocumentation]
* [https://www.ibm.com/docs/en/SSENW6_1.6.0/pdf/asmg1025_pdf.pdf High Level Assembler for z/OS & z/VM & z/VSE 1.6 General Information]
* [http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/360/asm/SC20-1646-6_int360asm_Aug70.pdf A Programmer's Introduction to IBM System/360 Assembler Language (Student Text)]
* [httphttps://publibz.boulderwww.ibm.com/epubsdocs/en/SSENW6_1.6.0/pdf/asmr1020asmr1024_pdf.pdf High Level Assembler for z/OS & z/VM & z/VSE Language Reference]
* [http://punctiliousprogrammer.com/ The Punctilious Programmer: IBM Mainframe Assembler]
* [https://www.amazon.com/dp/B00NS797PQ Basic IBM Mainframe Assembly Language Programming]