IBM Basic assembly language and successors: Difference between revisions

Content deleted Content added
Examples: There's an echo in here.
External links: HLASM URLs
 
(16 intermediate revisions by 9 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.
Line 241 ⟶ 239:
 
===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|page=7}}
 
===Assembler E and F===
Line 249 ⟶ 247:
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.org/pdf/ibm/370/MVS_XA/GC28-1143-2_MVS-XA_Conversion_Notebook_May84.pdf}}</ref>{{rp|page=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|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
| title = Module 24: SLAC Enhancements to and Beautifications of the IBM H-Level Assembler for Version 2.8
| author = Greg Mushial
Line 284 ⟶ 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
| title = IBM HIGH LEVEL ASSEMBLER/MVS & VM & VSE
| id = 292-244
| date = May 5, 1992
| url = http://www.ibm.com/common/ssi/cgi-bin/ssialias?infotype=an&subtype=ca&htmlfid=897/ENUS292-244&language=enus
| work = Announcement letters
| publisher = IBM Corporation
| accessdate = October 8, 2012
}}
</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
| title = IBM High Level Assembler for MVS & VM & VSE Release 2 Presentation Guide
| id = SG24-3910-01
Line 347 ⟶ 337:
Most significantly the Model 44 assembler lacks support for macros and continuation statements. On the other hand it has 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>
 
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>).<ref name=M44 />{{rp|pages=53,73}}
Line 370 ⟶ 360:
 
==Importance==
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 thruthrough 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.
 
==See also==
Line 387 ⟶ 377:
{{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]