General Characteristics
The architecture of IBM mainframes has undergone several extensions over the years, including System/360, System/370 XA, ESA/390, and z/Architecture. Each of these architectures has retained compatibility with most of the features of its predecessor. BAL uses the native instruction set of these machines. It is thus closer to the hardware than third-generation languages such as COBOL.
The instruction set consists of the low-level operations supported by the hardware, such as:
Instruction | Mnemonic | Description |
---|---|---|
LOAD | L | copy a value from memory to a register |
STORE | ST | copy a value from a register to memory |
COMPARE | C | compare a register value with a value in memory |
Shift | SLL, SRL | move the bits of a register left or right |
START SUBCHANNEL | SSCH | start a sub-channel I/O operation using a string of Channel Command Words |
The extreme simplicity of these operations means that 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 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.
Another reason to use assembler is that not all operating system functions can be accessed in high level languages. The application program interface of mainframe operating systems is defined as a set of assembly language "macro" instructions, that typically invoke Supervisor Call (SVC) or Diagnose (DIAG) hardware 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.
Read more about this topic: IBM Basic Assembly Language
Famous quotes containing the word general:
“Then comes my fit again. I had else been perfect,
Whole as the marble, founded as the rock,
As broad and general as the casing air.
But now I am cabined, cribbed, confined, bound in
To saucy doubts and fears.”
—William Shakespeare (15641616)