Professional Documents
Culture Documents
Lecture #2
Today’s Content
Pro tip for MIC paper : जो समझ में ना आएं उसको याद कर लो
Step 2 : Algorithm
Step 3 : Flowchart
2. Algorithm :
An algorithm is a set of well-defined instructions to solve a particular
problem. It takes a set of input and produces a desired output .
3. Flowchart :
A flowchart is a diagram that represents a set of instructions.
Flowcharts normally use standard symbols to represent the different types
of instructions. These symbols are used to construct the flowchart and
show the step-by-step solution to the problem.
4. Initialization Checklist :
In this step , you should prepare a checklist of all the variables , constant ,
methods etc . you are going to use in your program.
5. Choosing Instruction :
In this step we choose appropriate instruction according to our operation
needs or required command / instructions used to perform our task.
Editor
Assembler
Linker
Debugger
Editor :
- An editor is a program which allows you to create a file containing the
assembly language statements for your program.
Example: PC-Write, Wordstar.
- As you type in your program, the editor stores the ASCII codes for the letters
and numbers in successive RAM locations.
- When you have typed in all your program, you then save the file on the hard
disk. This file is called source file and the extension is .asm.
Assembler :
- An assembler program is used to translate the assembly language mnemonics
for instructions to corresponding binary codes. When you run the assembler, it
- On the first pass through the source program, the assembler determines the
displacement of named data items, the offset of labels, etc. and puts this
information in a symbol table.
- On the second pass through the source program, the assembler produces the
binary code for each instruction and inserts the offsets, etc. that it calculated
during the first pass.
- The assembler generates 2 files on the floppy disk or hard disk. The first file is
called object file (.obj).
- The second file generated by assembler is called the assembler list file and is
given extension (.lst).
Linker :
- A linker is a program used to join several object files into one large object file.
- The linker produces a link file which contains the binary codes for all the
combined modules. The linker also produces a link map file which contains the
address information about the linked files (.exe).
Debugger :
- The debugger allows you to look at the contents of registers and memory
locations after your program runs.
- It allows you to change the contents of registers and memory locations and re-
run the program.
- Some debuggers allow you to stop execution after each instruction so that you
can check or alter after each register contents.
- A debugger also allows you to set a breakpoint at any point in your program.
If you insert a breakpoint at any point in your program, the debugger will run
the program up to the instruction where you put the breakpoint and then stop the
execution.
Assembler Directives
Assembler directives are the directions to the assembler which indicate how an
operand or section of the program is to be processed. These are also called
pseudo operations which are not executable by the microprocessor. The
following section explains the basic assembler directives for 8086.
1. ASSUME : The ASSUME directive is used to inform the assembler the name
of the logical segment it should use for a specified segment.
Ex: ASSUME DS: DATA tells the assembler that for any program instruction
which refers to the data segment ,it should use the logical segment called
DATA.
2.DB -Define byte. It is used to declare a byte variable or set aside one or more
storage locations of type byte in memory.
5.DQ (define quadword) :This directive is used to tell the assembler to declare
a variable 4 words in length or to reserve 4 words of storage in memory .
6.DT (define ten bytes):It is used to inform the assembler to define a variable
which is 10 bytes in length or to reserve 10 bytes of storage in memory.
8.ORG -Originate : The ORG statement changes the starting offset address
of the data.
It allows to set the location counter to a desired value at any point in the
program.For example the statement ORG 3000H tells the assembler to set the
location counter to 3000H.
10. END- End program .This directive indicates the assembler that this is the
end of the program module.The assembler ignores any statements after an END
directive.
11. ENDP- End procedure: It indicates the end of the procedure (subroutine)
to the assembler.
12.ENDS-End Segment: This directive is used with the name of the segment to
indicate the end of that logical segment.