You are on page 1of 6

ELECTRICAL AND ELECTRONIC ENGINEERING

System Development
Editor
A program which allows you to create a file containing the assembly language statements for
your program.
Having a source code the user wants to type. The editor stores the ASCII codes for letters and
numbers in successive RAM locations. If you mae any error! the editor will let you bacup and
correct it. If you leave out a program statement! the editor will let you move everything down
and insert the line.
Having finished typing the program! you can save the file as a source file.
Assembler source file has a e"tension ***.asm.
Assembler
Is a program used to translate the assembly language mnemonics for instruction to
corresponding binary codes.
Assembler reads the source program through passes.
#
st
$ass
Assembler determines the displacement of named data items! offset of labels and puts this
information in a symbol table.
%
nd
$ass
Assembler passes through the source program to produce binary code for each instruction and
inserts the offset that it calculated during first pass.
Assembler generates two files namely ob&ect file '***.obj( and list file '***.lst(. )b&ect file
contains binary codes of instruction and information about respective addresses. *ist file shows
the assembler list file for the source program and contains code! statement and offset for each
instruction. A print file can be done from a list file.
A three pass assembler
the source code is scanned thrice
#
st
symbol table prepared
%
nd
listing file prepared
+
rd
ob&ect codes generated.
Linker
Is a program used to &oin ob&ect files into one large ob&ect file. The liner produces a lin file
which contains the binary codes for all the combined modules. *iner also produces a lin map
which contains the address information about lined files.
The program formed by the liner is relocatable since it can be put anywhere in memory to be
#
run. *in files have an e"tension '***.ee(
Lo!"tor
Is a program to assign the specific addresses of where the segments of ob&ect codes are to be
loaded in the memory. A ***.bin file is formed which has physical addresses.
Deb#$$er
This is a program whose application is to help a programmer detect bug's(. A bug is an error
introduced by the human programmer that results in the production of undesirable results by the
program.
Is a program which allows you to load your ob&ect code program into system memory! e"ecutes
the program and troubleshoot or debug it.
,ebugger allows you to loo at the contents of register and memory locations after your
program runs.
It allows you to stop e"ecution after each instruction so that you can chec or alter memory and
register contents.
It allows you set a breapoint at any point in your program. The debugger will run the program
until the point of the breapoint and then stop e"ecution. -ou can then e"amine registers and
memory contents to see whether the results are correct at that point. -ou can then insert other
breapoints depending on the correctness of the program.
,ebugger commands help you to .uicly find the source of a problem in your program. -ou can
then use your editor to correct the algorithm if necessary.
%e"t#res o& " deb#$$er
#. ,isplay register contents
The programmer can inspect the contents of certain ey registers during the e"ecution of the
ob&ect program
The programmer can modify the contents of certain registers or replace their contents
completely
$rogrammer is able to print the contents of a program
%. ,isplay/Replace memory contents
Can access any memory location! display! replace or modify the contents
+. Memory dump
The programmer is able to print out the contents of a specified group of memory locations
0. Can transfer memory contents and store in some other mass storage device
1. 2reapoints
Can place interrupting points in the ob&ect program to e"amine the current status of certain
critical C$3 registers! memory locations and I/) ports
4"ecution will always halt when program reaches a breapoint. The programmer can then
e"amine the various e"pected results to pinpoint and correct a problem
5. ,isassembly
%
It performs the reverse of the assembly process.
Lo"ders
4"ecutable programs must be stored in the program memory before it can be e"ecuted. To assist
the programmer in loading the program! special software tools called loaders are used.
*oader consists of a set of instructions that allows the input device to assign a starting address
in the RAM memory and R4A, I6 one word or byte of either instruction or datum at a time.
Bootstrap Loader
Is a program used to load the loader program such that application programs can then be loaded
to the program memory. It can be loaded manually from a dis by user eying I6 its file name
using the eyboard.
It can be in a R)M where it will only re.uire initiali7ation.
Absolute Loader
Is a program that loads each instruction of the ob&ect program in a fi"ed ! pre8established
memory location. Thus each instruction is given an absolute address.
*oader reads the ob&ect code line containing the starting address of instruction/data and loads
successive words /bytes in successive memory locations.
Serious drawbac is when multi8users or mi" of &obs need programs to be stored in different
memory locations at different times. If an absolute loader is used! the ob&ect program would
have to be modified and retranslated to reflect the different desired memory location prior to
each instruction which is time consuming.
Relocatable Loaders
Has features of absolute loader but allows user to select and specify the memory locations in
which the instructions/data words are stored. Thus the same program can be loaded in different
parts of the memory without having to reassemble or recompile them. ,uring assembly or
compiling of the ob&ect program! the program starts with address 9. Succeeding instructions are
assigned successive locations. These addresses of the instructions are relative instead of
absolute.
$rogrammer inserts the true starting address at the beginning of the relocatable loader. This
address is an offset that is added to each of the assigned memory locations in the program.
Advantages
$rogrammer has room for additional instructions or data words by repositioning the bloc
instructions or data in the memory.
Two or more pieces of programs or software modules can be loaded into contiguous locations in
the memory. A portion of the program can then be deleted and still maintain a single composite
program.
+
Relocatabilty
It is the ability of an assembler to relocate ob&ect modules. These modules may be accessed by
directives lie *ib! *in and locate. It allows programmers to code programs without worrying
about final arrangement of the ob&ect code in memory.
'erits
Memory management: *ocation of your future program if not a great concern to the
programmer and hence save time
Modular ,evelopment $rogrammer is able to code! test and debug simpler programs!
mae the program share program tass with other programmers and mae
changes on a program and easily relocate them to suit the applications
4"ample: Relocatable directive tells the assembler what address will be in the segment register at
e"ecution time.
("r"meter ("ssin$
A program can enter into a sub8routine by labeling the first instruction and ending the program
with R4T. The main program must call the subroutine and initiali7e the stac pointer to ensure
the return address is stored properly. The main program can place data and address in registers
before calling the subroutine! and subroutine can store results in the registers.
,ata and address re.uired by the subroutine is called parameter. The process of maing these
items available to the subroutine is called parameter passing.
$arameter passing refers to e"change of data between modules.
Example
global data
. data
num# db %%H
;
;
Adding proc far
mov al! <num#=
;
;
ret
adding endp
Register >ariables
This techni.ue involves passing and retrieving values using processor registers. Routines must
ensure that they do not corrupt any register other than those that have been specified.
0
Stac variables
$arameters may be passed using the stac. This involves pushing the values onto the stac
before the module is called. There are two ways in which data may be referenced using the
stac.
C"ll by )"l#e
Refers to placing copies of the data value on the stac. )nly the copy is wored with! the
original remains unchanged.
Transfer by value
The actual parameter is transferred
S8R receives a copy of the parameter
Modified value of the parameter by the S8R does not affect the old value elsewhere in the
program. Media of transfer are registers and memories
C"ll by Re&eren!e
$ass of address of the variable is done using the stac. The address is used to access the
data and hence original data used.
,ata types are arrays and records.
Transfer by reference
S8R receives a pointer to the parameter
Address of the parameter is passed between program and S8R
)nly one copy e"ists and S8R is able to access the parameter because the address is nown.
Any modification of the value changes the value globally.
The stac is the convenient medium of transferring information by reference.
(ro$r"m Re*entr"nt
This is the ability of a program to be interrupted and its parameters used by the interrupting
routine without corrupting any of the data re.uired by the first user. 4"ample is parameters
being passed to sub8routine via registers. The register contents are first saved before re8use in
the sub8routine. This
(osition Independent !ode
?
Is a code that can be placed anywhere in memory without re8computing the address or operand
Mov 'si @ dd(! nn A 6o absolute location is involved in the transfer of data..
1

You might also like