Sie sind auf Seite 1von 58

Assembler Programming Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved.


Assembler Programming Introduction

Course Details

Audience

This is an introductory level course for application and system programmers and others who wish to write
programs in Assembler Language. In addition, it is an appropriate introduction for individuals wishing a basic
introduction to System z architecture.

Prerequisites

The student should have a basic knowledge of computing concepts and terminology, and should be able to
program in a high level language.

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 2 of 58
Assembler Programming Introduction

Course Introduction
Assembler Language Introduction provides a basic introduction to programming at the Assembler level. The
architecture to programming at the Assembler level. The architecture of IBM System z is presented, with an
emphasis on storage addressing, use of registers and instruction formats.

The first unit, Assembler Language Overview, explains the format of both Assembler Language and
Machine Language instructions and is presented, along with the operation of the Assembler program, which
translates one to the other.

The second unit, Memory Usage, explains the methods of memory storage and allocation, arithmetical
operations of decimal, binary and hexadecimal numbers and the conversion from one system to the other.

The third unit, Addressing and Instructions, explains the difference between Assembler instructions,
Machine instructions and macro instructions, and how each is used.

The fourth unit, Program Development Process, describes the use of Assembler language syntax and the
conversion of Assembler Language to Machine Language using the Assembler Program.

The fifth unit, Defining Data unit, explains the Assembler instructions used in defining storage and data
areas, along with the use of literals.

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 3 of 58
Assembler Programming Introduction

Course Objectives

At the end of this course, you will be able to:

• Identify the major functions of an Assembler Language


program

• Trace the execution cycle of program instructions

• Provide a rationale for using Assembler Language

• Convert numbers and perform arithmetic between any


two of binary, decimal or hexadecimal

• Identify the parts of an Assembler Language instruction

• Convert instructions from Assembler Language format to


Machine Language

Continued…
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 4 of 58
Assembler Programming Introduction

Course Objectives (cont’d)

At the end of this course, you will be able to:

• Describe the characteristics of program flow

• Identify the coding format rules and major functions


associated with Assembler Language

• Identify the steps in converting an Assembler Language


program into an executable Machine Language program

• Describe the information provided in an Assembler


Language program listing

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 of 58
Assembler Programming Introduction

UNIT Assembler Language Overview

Topics:
 Language Hierarchy

 Assembler Program Components

 Program Components

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 6 of 58


Assembler Programming Introduction
Unit: Assembler Language Overview

Unit Introduction

Assembler Language is the language most closely related to the instruction set of a computer –
its Machine Language. This unit answers some fundamental questions that many students ask
when beginning to learn this language.

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 7 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview

Unit Objectives

At the end of this topic, you will be able to:

• Identify the functions of an Assembler program

• Specify how Machine Language, Assembler Language


and High Level Languages differ

• Identify advantages of coding in Assembler Language

• Order the steps in preparing an Assembler program for


execution

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 of 58
Assembler Programming Introduction

UNIT Assembler Language Overview

Topics:
 Language Hierarchy

 Assembler Program Components

 Program Components

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 9 of 58


Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Topic Objectives

At the end of this topic, you will be able to:

• Identify functions of an Assembler program

• Specify how characteristics of Machine Language differ


from Assembler Language

• Identify advantages of coding in Assembler Language

• Order the steps in preparing an Assembler program for


execution

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 10 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Using Computers for Various Functions

How can computers be used?

The usefulness of computers can be highlighted


with the following points:

• Computers are powerful devices; they


are able to perform a wide range of tasks

• A computer is controlled by a program,


which tells the computer exactly what to
do

• Different programs can be loaded and


executed, making the computer behave
in the required way

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 11 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Machine Language

What is Machine Language?

Computers are controlled by a program in


Machine Language. It is a cryptic language that INSTRUCTION
consists of strings of binary ones and zeroes.
INSTRUCTION
Machine Language Instructions contain codes to CPU
represent the operations to be performed and the INSTRUCTION
instruction
address of the data where it has to be performed. STORAGE AREA
STORAGE AREA A
A

What is a program? STORAGE AREA B

CONSTANT
A program consists of instructions and various
CONSTANT
types of data areas.
STORAGE AREA
STORAGE AREA C
C DATA

STORAGE AREA D

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 12 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

MOVE Instruction

What is a MOVE Instruction?

A MOVE Instruction transfers data from one storage location to another.

The above example shows the machine


language format of a MOVE Instruction.

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 13 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

When a computer is ready to execute an instruction, the instruction must be in ___________


language.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 14 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

Machine Language instructions consist of ______________ of information.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 15 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Assemblers

What are Assemblers?

In the very early days programmers wrote in


Machine Language. It was a slow, tedious and
error prone process, only feasible for short and
simple programs. To simplify the task of
Programming and allow larger programs to be
created, programs called Assemblers were
created.
11010010 00001111 01000000 00001000 00011000 00011000

ASSEMBLER LANGUAGE

MVC PLACE 1, PLACE 2

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 16 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Assemblers (cont’d)

Assembler allowed programmers to write in


Assembler Language. Although an Assembler
Language program had the same number of
instructions as the equivalent machine program,
writing Assembler program is much simpler.

In Assembler Language, operations are


represented by mnemonic codes (such as MVC
for MOVE) and the data is represented by
symbolic codes (such as PLACE1) rather than
addresses.
11010010 00001111 01000000 00001000 00011000 00011000

SYMBOLIC NAMES
MENEMONIC CODE ASSEMBLER LANGUAGE

MVC PLACE 1, PLACE 2

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 17 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Assemblers (cont’d)

What is the function of the Assembler?

The Assembler reads a program written in Assembler Language, as input and translates it into Machine
Language program as output. The Machine Language program can then be executed.

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 18 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Assemblers (cont’d)

How are Assembler programs written?

Though writing Assembler Language is a detailed


process, it is much easier than writing in Machine COBOL
Language.
ADD A TO B

The Assembler programmer has to specify in


detail, exactly what the computer has to do to
perform each part of the total programming task.

The example on the right shows the four ASSEMBLER (OR MACHINE LANGUAGE)
Assembler instructions that might be needed to
add two numbers together. PACKX,A (11110010.........)
PACKY,B (11110010.........)
APX,Y (11111010.........)
UNPKB,X (11110011.........)

The example in the slide shows the four


Assembler instructions that might be
needed to add two numbers together.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 19 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

The ______________ is a program that converts Assembler language to Machine Language


format.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 20 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

Which of the following are advantages of Assembler Language?

A. It has fewer instructions than Machine Language

B. Operations can be represented by mnemonic codes

C. Data is represented by symbolic names

D. Processes such as adding numbers together can be created as a single operation

Review Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 21 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

High Level Languages

What is a High Level Language?

High Level Languages (HLL) go one step further COBOL


than Assembler languages in simplifying the HLL (COBOL)
programming task.
ADD A TO B

In a HLL, the program is expressed at a higher


level of abstraction.

An Assembler language program might contain


five or ten times as many instructions as the same
program written in a HLL. PACKX,A (11110010.........)
PACKY,B (11110010.........)
AP X,Y (11111010......…)
UNPKB,X (11110011.........)

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

High Level Languages (cont’d)

What is a compiler?

A program called a compiler reads a HLL program as input and translates it into a Machine Language
Program.

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 23 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

High Level Languages (cont’d)

Listed below are some examples of HLL:

 Fortran – first HLL language in general


use, developed for scientific and general COBOL ADD A TO B GIVING C
computing

FORTRAN C=A+B
• COBOL – another early HLL, designed
to facilitate the programming of business
and commercial programs
C C:=A+B; /*ADD A TO B*/

• C – most popular in use today for a wide


range of programming tasks
C** - C:=A+B; //ADD A TO B

• C++ and Smalltalk – object oriented


languages that are becoming
increasingly popular

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Advantages of HLL and Assembler Language

What are the advantages of HLL over


Assembler Language?

HLL is advantageous over Assembler Language


because of the following reasons:

• Ease of development
• Portability

What is the advantage of Assembler S/390 S/400


Language? Assembler Assembler

S/390 Processor AS/400 Processor


Assembler Language contains statements that
correspond instruction by instruction to the
Machine Language of the computer. INTEL RS/6000
Assembler Assembler

INTEL Processor RS/6000 Processor

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 25 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

Match the term on the left with its description on the right.

1. Compiler A. A program that converts Assembler Language to Machine


Language

2. Assembler B. A programming language that has one-to-one correspondence


with Machine Language instructions

3. Assembler Language C. An early HLL developed for language for programming


commercial and business applications

4. COBOL D. A program that converts HLL to Machine Language

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 26 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

Which of the following are advantages of HLL over Assembler Languages?

A. They can often express an operation as a simple statement

B. They can be compiled and run on many platforms

C. They do not have to be converted to Machine Language before execution

D. They share a one-to-one relationship with Machine Language

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 27 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Advantages of Assembler Language

Why program in Assembler Language?

Assembler Language is chosen for programming


because of the following reasons:

• It provides extensive control of the


hardware environment

ASSEMBLER ADVANTAGES
• Assembler Language instructions
correspond one-for-one with machine
instructions making it possible to do
P Control of environment
anything the hardware allows

HLLs on the other hand, do not provide the


programmer with extensive control of the
hardware. The efficiency of a HLL program is
subject to the way the compiler translates the HLL
program.

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 28 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Advantages of Assembler Language (cont’d)

Assembler may also be considered when


efficiency is a major concern.

A compiler must be designed to translate all


possible valid combination of HLL code, and in
some cases may not translate it to produce the
most efficient Machine Language. Assembler
instructions are translated one-for-one into ASSEMBLER ADVANTAGES
Machine Language, and a good Assembler
programmer can achieve the maximum efficiency
P Control of environment
of Machine Language code. P Maximum efficiency

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 29 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Advantages of Assembler Language (cont’d)

It may not be necessary to code a whole program


in Assembler Language to achieve the benefits of
increased efficiency. Coding only those parts of a
program which are executed frequently may
achieve significant efficiency gains.

In many cases, Assembler coding is not done for


a whole system or even a whole program, but
only for selected modules.

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 30 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Are We on Track?

Which of the following are reasons you might decide to use Assembler?

A. To ensure the program is portable

B. To have detailed control of the hardware environment

C. To ensure the program is translated into the most efficient Machine Language

D. To eliminate the compiling step in program development

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Glossary

Architecture – The design of computer hardware; incorporating storage, registers, instruction set
and other features.

Bit – The smallest unit of information handled by a computer. One bit expresses a 1 or 0
in binary numerals or a true or false in logic condition, and is represented physically
by an element such as a high or low voltage at one point on the circuit or a small
spot on a disk.

Mnemonic Code – A word, rhyme or other memory aide used to associate a complex or lengthy set of
information with something that is simple and easy to remember. Mnemonics are
widely used in computing. Programming languages other than machine language
for example are known as symbolic languages because they use short mnemonics
such as AD (for addition) and DEF (for define) to represent instructions and
operations.

Accumulator – Register used for logic or arithmetic, usually to count items or accumulate a sum.

Compiler – A program that translates all the source code of a program written in a High-Level
Language into object code, prior to the execution of the program.

Continued…
Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 32 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Glossary (cont’d)

Fortran – Short for formula translation. The first High-Level computer language.

COBOL – Acronym for Common Business Oriented Language. A verbose, English-like


compiled programming language developed in the late 50s’ and still in widespread
use today, usually for business application typically run on mainframes.

Exit Routines – A user written program segment, designed to be incorporated at a designated point
in an operating system module or utility program.

Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 33 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Language Hierarchy

Topic Summary

Now that you have completed this topic, you should be able to:

• Identify functions of an Assembler program

• Specify how characteristics of Machine Languages differ


from Assembler Language

• Identify advantages of coding in Assembler Language

• Order the steps in preparing an Assembler program for


execution

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 34 of 58
Assembler Programming Introduction

UNIT Assembler Language Overview

Topics:
 Language Hierarchy

 Assembler Program Components

 Program Components

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 35 of 58


Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Topic Objectives

At the end of this topic, you will be able to:

• Understand requirements of program execution

• Understand the importance of General Purpose


Registers (GPRs)

• Define a Data Control Block (DCB)

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Program Execution

What is an Image?
ADDRESS SPACE
In order for a program to execute, it must be
loaded into the memory or main storage area of
the computer. The image is a program which is
loaded into the memory in order to execute in the
Assembler program space.

What does the program space consist of?

A program space consists of:


• Executable Machine Language
Machine Language Instructions 10110010
instructions
Variable Data
• Areas to store the program’s variable Constant Data
data File Definitions 8 BITS

• The program’s constant data 1 BYTE


• File definitions for use in Input/Output
operations

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 37 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Program Execution (cont’d)

Program execution is basically sequential. After


one instruction completes, the execution
continues at the next sequential memory address,
except for a few instructions which change the
instruction sequence. ADDRESS SPACE

Executable Instructions

Constants

General Storage Areas

File Definitions

I/O Areas

Other

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 38 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Program Execution (cont’d)

The programmer must group the various areas


of the program so that only instructions are
executed. Data areas, constant definitions, and
file definitions must be placed within the program
space so that they are accessible to the MOD 1
INSTRUCTION
program’s instructions, but will not be executed. DATA

MOD 2
INSTRUCTION
DATA

MOD 3
INSTRUCTION
DATA

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 39 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Are We on Track?

Of the following program elements, which one is normally placed at the beginning of
an address space?

A. Instructions

B. Data areas

C. Constant definitions

D. File definitions

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 40 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Are We on Track?

Assembler program instructions are executed ____________.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 41 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

General Purpose Registers

What are General Purpose Registers?

ADDRESS SPACE
The architecture of S/390 computers
provides 16 General Purpose Registers Executable Instructions
(GPRs). GPRs are part of the hardware of the
Constants
computer, and can be used by any Assembler
program when executing. General Storage Areas

File Definitions
What are the functions of GPRs?
I/O Areas
GPRs are very important to the Assembler
Other
programmer. They are used in addressing both
instruction and data, and also for performing
binary arithmetic, counting for loops and many
General Purpose Registers
other purposes.
GPRs are also used in conventional ways, 0 1 2 15
passing control and data from one module to
another.
Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 42 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

General Purpose Registers (cont’d)

Essentials of GPRs

Effective management of GPRs is a basic skill


required of the Assembler programmer. It is
important to know which registers are available
and for what purposes specific GPRs must be 0 1 2 3 15
reserved.

Binary Address
Arithmetic Values

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 43 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Are We on Track?

How many GPRs are part of the hardware of the hardware of S/390 computer?

A. 12

B. 16

C. 34

D. 22

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 44 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Are We on Track?

Which of the following are uses for GPRs?

A. Addition of binary numbers

B. Holding address values that can be used to reference storage areas

C. Passing control and data from one module to another

D. Holding areas from Machine instructions.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 45 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Data Control Block Definition

What is a DCB ?

A file definition, called a Data Control Block


(DCB) must be created for each file the
Assembler programmer wishes to access in a ADDRESS SPACE
program. The DCB is a special kind of data area,
which maintains information about an external Executable Instructions
file. The DCB is created using a system macro
instruction. Constants
File Definitions - DCB
General Storage Areas
The DCB contains the following:
INFILE …, …,
File Definitions
OUTFILE …, …,
• Name used to refer to the data I/O Areas
• The format and size of the records and
blocks within the dataset
• Types of instructions used to access the
dataset and the current status of the
dataset

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 46 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Macro Instructions

What are macro instructions?

Assembler Language instructions generally


correspond one-for-one with Machine Language
instructions. However there are some situations
where it is not feasible for the Assembler
Language programmer to code at this detailed
level.

To help the programmer cope with such complex


situations, the Assembler provides macro
instructions. A macro instruction is an instruction
that is processed by the assembler to generate a
group of Assembler instructions.

Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 47 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Macro Instructions Definition (cont’d)

What are macro instructions?


Program Source Code Program Source Code
The I/O macro instructions like OPEN, CLOSE,
GET, PUT and ENTRÉE create multiple
Assembler instructions to perform the specific I/O BEGIN ENTREE +BEGIN ENTREE
NEXT MVC +BEGIN STM
operation required. SR + BALR
AR + USING
+ ST
The DCB macro instruction generates the various + LA
data areas and constants necessary to maintain + ST
information about an external file. The Assembler etc + LR
NEXT MVC
program only has to know how to handle I/O at a SR
high level. The expansion of the macro instruction AR
into multiple low level instructions generates the
detailed level code.
etc

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 48 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Are We on Track?

An instruction that is processed by the Assembler in order to generate a group of Assembler


instructions is called a(n) _____________ instruction.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 49 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Glossary

Image – A duplicate, copy or representation of all or part of a hard or a floppy disk, a section
of memory or hard drive, a file, a program or data.

File Definition – A way of identifying data to be read from or written to a peripheral device.

DCB – Data Control Block. A file definition, maintaining information about an external file.
The DCB is created using a system macro instruction.

Macro Instruction – A name that defines an instruction or a set of instructions that are substituted for
the macro name wherever the name appears in the program when the program is
compiled or assembled.

Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 50 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Assembler Program Components

Topic Summary

Now that you have completed this topic, you should be able to:

• Understand requirements of program execution

• Understand the importance of General Purpose


Registers (GPRs)

• Define a Data Control Block (DCB)

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 51 of 58
Assembler Programming Introduction

UNIT Assembler Language Overview

Topics:
 Language Hierarchy

 Assembler Program Components

 Program Components

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 52 of 58


Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Program Components

Topic Objectives

At the end of this topic, you will be able to:

• Describe the functions of a Macro Instruction

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 53 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Program Components

Functions of Macro Instructions

Macro instructions are useful because of the


following reasons:
MACRO INSTRUCTION

• You can create your own macro


instructions to decrease the tedium of (ENTREE) +BEGIN ENTREE
+BEGIN
coding common instruction sequences
EXISTING
multiple times. STATEMENTS

• It provides a common method of


performing a certain action.

• The macro facility in Assembler


Language is a powerful one. It allows
you to create new language statements
by defining them in terms of existing
statements.

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 54 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Program Components

Are We on Track?

Which of the following are I/O macro instructions

A. OPEN

B. CLOSE

C. LOAD

D. GET

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 55 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Program Components

Are We on Track?

The programmer can create new, higher level statements in Assembler Language using the
______________ facility.

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 56 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview Topic: Program Components

Topic Summary

Now that you have completed this topic, you should be able to:

• Describe the functions of a Macro Instructions

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 57 of 58
Assembler Programming Introduction
Unit: Assembler Language Overview

Unit Summary

Now that you have completed this unit, you should be able to:

• Identify the functions of an Assembler program

• Specify how Machine Language, Assembler Language


and High Level Languages differ

• Identify advantages of coding in Assembler Language

• Order the steps in preparing an Assembler program for


execution

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 58 of 58