Content deleted Content added
Peter Flass (talk | contribs) Delete insignificiant "trivia", insert note on exits and interfaces |
→External links: HLASM URLs |
||
(28 intermediate revisions by 12 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]]
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 98 ⟶ 96:
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
<syntaxhighlight lang="text">
Line 141 ⟶ 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}}. -->
Line 174 ⟶ 172:
</syntaxhighlight>
The following is the ubiquitous [["Hello,
<syntaxhighlight lang="text">
Line 187 ⟶ 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 226 ⟶ 224:
| access-date = April 5, 2022
}}
</ref>{{rp|pages=59–61}}
The [[BOS/360|Basic Operating System]] has two assembler versions. Both require 16 KB memory, one is tape resident and the other disk.<ref>{{cite manual
| title = IBM System/360 Basic Operating System Language Specifications Assembler (16K Disk/Tape)
Line 237 ⟶ 236:
| access-date = April 5, 2022
}}
</ref>{{rp|
===Assembler D===
Assembler D was the [[DOS/360 and successors|DOS/360]] assembler for machines with a memory size of 16 KB. It came in two versions: A 10 KB variant for machines with the minimum 16 KB memory, and a 14 KB variant for machines with 24 KB. An F-level assembler was also available for DOS machines with 64 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|
===Assembler E and F===
Assembler E was designed to run on an OS/360 system with a minimum of 32 KB of main storage, with the assembler itself requiring 15 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|
===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.
===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 KB (virtual). Recommended size is 128 KB.<ref>{{cite book|last=IBM Corporation|title=OS/VS Assembler Programmer's Guide|year=1973|url=http://bitsavers.
===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=
| title = Module 24: SLAC Enhancements to and Beautifications of the IBM H-Level Assembler for Version 2.8
| author = Greg Mushial
Line 283 ⟶ 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
▲</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 299 ⟶ 290:
| url = http://www.redbooks.ibm.com/redbooks/pdfs/sg243910.pdf
| url-status = dead
|
|
| publisher = [[IBM]]
| access-date = September 29, 2023
}}
</ref>{{
====High Level Assembler Toolkit====
Line 334 ⟶ 325:
| 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
The DPS/TPS assembler is a somewhat restricted version of System/360 BPS/BOS Assembler.<ref name=M20 />{{rp|
===IBM System/360 Model 44 PS assembler===
Line 346 ⟶ 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.
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|
===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|
===Assembler G===
Line 369 ⟶ 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
==See also==
Line 386 ⟶ 377:
{{Wikibooks|360 Assembly}}
* [https://www.ibm.com/docs/en/hla-and-tf/1.6.0?topic=
* [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)]
* [
* [http://punctiliousprogrammer.com/ The Punctilious Programmer: IBM Mainframe Assembler]
* [https://www.amazon.com/dp/B00NS797PQ Basic IBM Mainframe Assembly Language Programming]
|