Unit2 Assebly-Prog
Unit2 Assebly-Prog
Unit2 Assebly-Prog
Chapter 2 Marks 08
Art of Assembly Language Programming
2.0 Introduction:
Each personal computer has a microprocessor that manages the computer's arithmetical, logical and
control activities.
Each family of processors has its own set of instructions for handling various operations like getting input
from keyboard, displaying information on screen and performing various other jobs. These set of
instructions are called 'machine language instruction'.
Processor understands only machine language instructions which are strings of 1s and 0s. However
machine language is too obscure and complex for using in software development. So the low level assembly
language is designed for a specific family of processors that represents various instructions in symbolic code
and a more understandable form.
1. Defining the problem: The first step in writing program is to think very carefully about the problem that
the program must solve.
2. Algorithm: The formula or sequence of operations to be performed by the program can be specified as a
step in general English is called algorithm.
4. Initialization checklist: Initialization task is to make the checklist of entire variables, constants, all the
registers, flags and programmable ports
5. Choosing instructions: Choose those instructions that make program smaller in size and more
importantly efficient in execution.
6. Converting algorithms to assembly language program: Every step in the algorithm is converted into
program statement using correct and efficient instructions or group of instructions.
1. Editors
2. Assembler
3. Linker
4. Debugger.
Program Development
• Problem: must convert ideas (human thoughts) into an executing program (binary image in memory)
• The Program Development Process uses a set of tools to provide a people-friendly way to write programs
and then convert them to the binary image.
1. Editor
An editor is a program, which is used to construct assembly language program inappropriate format so that
the assembler will translate it correctly to machine language.
Programming Language
– Syntax: set of symbols + grammar rules for constructing statements using symbols
– Assembly Language : A readable language that maps one-to-one to the machine instructions, to what
operations are supported by the CPU.
• May contain unresolved references (ie. file contains some or all of complete program)
3. Linker : A program that combines object files to create an single “executable” file
– Major functional difference is that all references are resolved. (ie. Program contains all parts needed to
run)
4. Loader : A program that loads executable files into memory, and may initialize some registers (e.g. IP )
and starts it going.
5. Debugger : A program that loads but controls the execution of the program. To start/stop execution, to
view and modify state variables