Professional Documents
Culture Documents
Electrical Manual PDF
Electrical Manual PDF
LABORATORY MANUAL
(FOR ME)
SECTION-A
1
EEE LAB MANUAL MRCET
AIM: To perform Swinburne’s test on the given D.C machine and predetermine the
efficiency at any desired load both as motor and as generator.
APPARATUS REQUIRED:
S.NO Description Type Range Quantity
1 Ammeter MC 0-2A,0-1A,0-10A 3no
2 Voltmeter MC 0-30V,0-300V 2no
3 Rheostat WW 370 Ω /2A 1no
4 Tachometer Digital 0-10000rpm 1no
CIRCUIT DIAGRAM:
2
EEE LAB MANUAL MRCET
THEORY:
This test is to find out the efficiency of the machine .It is a simple indirect method in
which losses are determined separately and from their knowledge, efficiency at any
desired load can be predetermined. The only test needed is no-load test. This test cannot
be performed on DC series motor. The machine is run as a no load shunt motor at rated
speed and with a rated terminal voltage .However, this test is applicable to those
machines in which flux is practically constant.
The constant losses in a dc shunt machine= Wc = stray losses (magnetic & mechanical
losses) +shunt field copper losses.
PROCEDURE
1) Make all the connections are as per the circuit diagram.
2) Keep the field rheostat in minimum resistance position.
3) Excite the motor with 220V, DC supply by closing the DPST switch and start the
Motor by moving the handle of 3-point starter from OFF to ON position.
4) By adjusting the rheostat in motor field bring the speed of the motor to its rated value.
Note down the readings of Ammeter and Voltmeter at no load condition.
5) The necessary calculations to find efficiency of machine as motor & generator at any
given value of armature current is done.
3
EEE LAB MANUAL MRCET
MODEL CALCULATIONS:
For motor:
IL= Ia+Ish
Input = VIL
Cu losses = Ia2 Ra
Total losses =No load losses or constant losses(Wc)+ cu losses
%Efficiency ( η) = (Output/Input)*100
Output = input-total losses
For generator:
Ia= IL +Ish
Input = VIL
Cu losses = Ia2 Ra
Total losses =No load losses or contant losses(Wc) + cu losses
%Efficiency ( η) = (Output / Input)*100
Output = input - total losses
TABULAR COLOUMN:
Voltmeter Ammeter Ammeter
Speed in
S.NO reading Reading reading
RPM
V Volts ILO in Amps Ishin Amps
CALCULATION TABLE:
As a Motor:
S.NO IL ( A) Ia=(IL-Ish)A W=Ia2Ra in Total %Efficiency
watts losses
4
EEE LAB MANUAL MRCET
As a Generator:
S.NO IL (A) Ia=(IL+Ish) W=Ia2Ra Total %Efficiency
in A in watts losses
MODEL GRAPH:
PRECAUTIONS:
1. We should start the motor under no load
2. Take the reading without parallax error.
3. The connections must be tight.
4. If voltmeter gives ding then interchange voltmeter terminal connecting of
voltmeter.
RESULT:
QUESTIONS:
1. Why the magnetic losses calculated by this method are less than the actual value?
2. Is it applied to D.C series machines?
3. Comment on the efficiency determined by this method.
5
EEE LAB MANUAL MRCET
APPARATUS REQUIRED:
S.NO Description Type Range Quantity
0-20A
1 Ammeter MI 2no
0-5A
0-150V
2 Voltmeter MI 2no
0-300V
LPF 2A,!50V
3 Wattmeter 2no
UPF 20A,300V
Auto
4 - 230/0-270V 1no
transformer
CIRCUIT DIAGRAM:
6
EEE LAB MANUAL MRCET
THEORY:
Transformer is a device which transforms the energy from one circuit to other circuit
without change of frequency.
The performance of any transformer can be determined by conducting tests. The OC and
SC tests are conducted on transformer to find the efficiency and regulation of the
transformer at any desired load current.
OC TEST:
The objectives of OC test are
1. To find out the constant losses or iron losses of the transformer.
2. To find out the no load equivalent parameters.
SC TEST:
The objectives of SC test are
1. To find out the variable losses or copper losses of the transformer.
2. To find out the short circuit equivalent parameters.
By calculating the losses and equivalent parameters from the above tests the efficiency
and regulation can be calculated at any desired power factor.
7
EEE LAB MANUAL MRCET
8
EEE LAB MANUAL MRCET
‘-‘
O.C TEST OBSERVATIONS:
TBLER COLUMN:
S.NO % OF LOAD EFFICIENCY
9
EEE LAB MANUAL MRCET
TABULATION:
LAGGING POWER FACTOR LEADING POWER FACTOR
SNO PF %REG SNO PF %REG
1 0.3 0.3
2 0.4 0.4
3 0.5 0.5
4 0.6 0.6
5 0.7 0.7
6 0.8 0.8
7 0.9 0.9
8 UNITY UNITY
MODEL GRAPHS:
1. EFFICIENCY VS OUTPUT
10
EEE LAB MANUAL MRCET
RESULT:
QUESTIONS:
1) What is a transformer?
2) Draw the equivalent circuit of transformer?
3) What is the efficiency and regulation of transformer?
11
EEE LAB MANUAL MRCET
Voltage 415V
Current 7.46A
Power 5HP
Speed 1500rpm
Frequency 50Hz
APPARATUS REQUIRED:
CIRCUIT DIAGRAM:
12
EEE LAB MANUAL MRCET
THEORY:
It is the direct method to find the efficiency of the induction motor. In this test the breakig
of the rotor is done with the help of the belt which surrounds the pulley by using spring
balances. When the braking power is increased by tightening the springs then the line
current is increased.
PROCEDURE:
1. Connect the circuit as per the circuit diagram.
2. Observing precautions close the TPST switch.
3. Apply he rated voltage to the stator windings of 3 Phase induction motor with the help
of starter.
4. Note down the readings of all meters on no-load.
5. Load the induction motor in steps using the brake-drum arrangement. At each step note
down the readings of all meters up to full load of the motor.
6. Gradually release the load and switch OFF the supply.
7. Using thread, measure the circumference of the brake-drum when motor is at rest.
MODEL CALUCLATIONS:
Force on pulley (F)=(S1-S2)*9.81*W ( N)
Torque (T) =Force(F)* Re. N-m
Output power of the motor = (S1-S2)*Re*9.81*W(watts)
W=2πN/60.
S1, S2 = weights on the pulley.
Re= Effective radius of the pulley.
W=motor speed in rad/sec.
If V is the terminal voltage IL is the line current and cosΦ is the power factor.
Power in put =V*IL* cosΦ watts.
Efficiency (%η)=(w(S1-S2)*Re*9.81/V*IL* cosΦ)*100
%slip=Ns –N/Ns
13
EEE LAB MANUAL MRCET
TABLER COLUMN:
MODEL GRAPHS:
1. Output Vs Efficiency
2. Output Vs Torque
3. Slip Vs Torque
14
EEE LAB MANUAL MRCET
RESULT:
QUESTIONS:
1) What is motor?
2) Why test is conducted on motor?
3) What is break test and what is the disadvantage of break test?
16
EEE LAB MANUAL MRCET
APPARATUS REQUIRED:
S.NO Description Type Range Quantity
1 Ammeter MI 0-20A 0-2A 2
0-30V
2 Voltmeter MI 2
0-300V
3 Rheostat WW 370 Ω /2A 1
0-220V
4 D.C supply 1
5 Tachometer Digital 0-10000rpm 1
CIRCUIT DIAGRAM:
OC &SC TEST:
17
EEE LAB MANUAL MRCET
18
EEE LAB MANUAL MRCET
RESULT:
QUESTIONS:
19
EEE LAB MANUAL MRCET
AIM: To control the speed of a DC shunt motor using the following methods
i). field flux control
ii). Armature voltage control
APPARATUS:
S.No Equipment Type Range Qty
1 DC shunt motor DC 220V 1
2 Rheostat Wire wound 370Ω/2.5A 2
3 Ammeter MC (0-2)A 1
4 Voltmeter MC (0-220)V 1
5 Tachometer Digital (0-30000)rpm 1
CIRCUIT DIAGRAM:
20
EEE LAB MANUAL MRCET
THEORY:
The term speed control means intentional sped variation, carried out manually or automatically.
DC motors are most suitable for wide range speed control and are therefore indispensible for
many adjustable speed drives. The speed of a motor is given by
Wm = (Vt-IaRa)/Kaф
Where Ka – armature constant = PZ/2∏A
And ф is the flux per pole.
Hence it follows that, for a DC motor, there are basically three methods of speed control and
these are:
1. Variation of resistance in armature circuit
2. Variation of the field flux
3. Variation of armature terminal voltage.
Variation of the field flux:
This method of speed control, also called as flux weakening method or filed current control
method gives speeds above the base speed only. Base speed is nothing but the rated speed of the
machine. This is one of the simplest and economical methods and is, therefore extensively used
in modern electric drives. Under steady state running conditions, if the field circuit resistance is
increased, the field current and hence the field flux are reduced. Since the rotor speed cannot
change suddenly due to inertia, a decrease in field current causes a reduction of counter emf. As
a result of it, more current flows through armature. The percentage increase in armature current
is much more than the percentage decrease in the field current. In view of this, the
electromagnetic torque is increased and this being more than the load torque, the motor gets
accelerated. The disadvantages of this method are:
a. The armature may get over heated at higher speeds, because the increased armature
current results in more ohmic losses whereas cooling by ventilation doesnot improve
proportionally.
b. If the field flux is weakened considerably, the speed becomes very highand due to these
changes; the motor operation may become unstable.
Variation of armature terminal voltage:
If the voltage applied to the armature changes the speed changes directly with it. Using this
method, speeds below rated speeds are attained.
PROCEDURE:
7. Vary the field rheostat in steps and for each step note down the ammeter and tachometer
readings. Take 10 to 15 such readings.
8. Set both the rheostats to their initial positions and open the DPST switch.
TABULAR COLUMN:
N
S.No Va(Armature (Speed(rpm))
Voltage(volts))
S.No If(Field N
current(amperes)) (Speed(rpm))
MODEL GRAPHS:
22
EEE LAB MANUAL MRCET
RESULT:
QUESTIONS:
1. What are the three methods of speed control?
2. What is the main purpose of speed control?
3. Why is three point starters not used in this circuit?
4. What is the method opted to get speeds above rated speed?
5. How is flux per pole related to the speed of the machine?
23
EEE LAB MANUAL MRCET
AIM:To conduct the brake test on a given D.C shunt motor and to draw its performance
curves.
APPARATUS REQUIRED:
S.NO Description Type Range Quantity
1 Ammeter MC 0-20A 1no
2 Voltmeter MC 0-300V 1no
3 Rheostat WW 370 Ω /2A 1no
4 Tachometer Digital 0-10000rpm 1no
CIRCUIT DIAGRAM:
24
EEE LAB MANUAL MRCET
THEORY:
This test is direct test to find the efficiency of the DC shunt motor. In this test the motor directly
loaded by connecting brakes which are with pulley and motor is subjected to rated load so the
entire power is wasted. The belt around the water cooled pulley has its ends attached to spring
balances s1and s2.The belt tightening hand wheels h1 and h2 help in adjusting the load on the
pulley so that the load on the motor can be varied.
PROCEDURE:
1. All the connections are as per the circuit diagram.
2. 220V, DC supply is given to the motor by closing DPST switch.
3. Move the 3-point starter handle form ‘OFF’ to ‘ON’ position slowly and motor
Starts running.
4. Vary the field rheostat until the motor reaches its rated Speed and take voltmeter and ammeter
readings.
5. Apply the land by break drum pulley and for each applications of load the
Corresponding Voltmeter (V), Ammeter (I), spring forces S1 & S2 and Speed (N)
Readings are noted.
6. Calculate output & efficiency for each reading.
7. Note down all the readings in the tabular form carefully.
8. Remove the load slowly and keep the rheostat as starting position and switch
‘OFF’ the supply by using DPST switch.
MODEL CALUCLATIONS:
TABLER COLUMN:
S. Voltage Current Input Forces Net Torque(T) Speed O/p= %Efficiency
NO (V) (A) =VI inKG forces =F*Re*9.81 in 2πNT/60 η=output/input
watts S1 S2 F= (N-M) RPM (Watts)
S1~S2 (N)
in kg
25
EEE LAB MANUAL MRCET
GRAPH:
The graph is drawn between
a) Output in Watts Vs Speed(N) in RPM
b) Output in Watts Vs Torque (T) in N-m
c) Output in Watts Vs Current (I) in A
d) Output in Watts Vs Efficiency (%η)
By taking output in Watts on X axis and speed, Torque, current, Efficiency onY- axis .
MODEL GRAPH:
PRECAUTIONS:
1. Initially 3-point starter should be kept at ‘OFF’ position and later it must be varied slowly and
uniformly from ‘OFF’ to ‘ON’ position.
2. The field regulator must be kept at its minimum output position.
3. The brake drum of the motor should filled with cold water.
4. The motor should be started without load.
RESULT:
QUESTIONS:
1 .Why a 3-point starter is used for starting a D.C shunt motor?
2. If a 3-point starter is not available, how can a D.C motor be started?
3. Explain the function of overload release coil in 3-point starter.
26
EEE LAB MANUAL MRCET
AIM: To obtain the no load characteristics of a DC shunt generator and to determine the critical
field resistance.
APPARATUS REQUIRED:
CIRCUIT DIAGRAM:
27
EEE LAB MANUAL MRCET
THEORY:
Magnetization curve is relation between the magnetizing forces and the flux density B. this is
also expressed as a relation between the field current and the induced emf , in a D.C machine.
Varying the field current and noting corresponding values of induced emf can determine this.
For a self-excited machine the theoretical shape of the magnetization
Curve is as shown in the figure. The induced emf corresponding to residual magnetism exists
when the field current is zero. Hence the curve starts, a little above the origin on y-axis. The field
resistance line Rsh is a straight-line passing through the origin.
PROCEDURE:
1) All the connections are as per the circuit diagram.
2) 220V, DC supply is given to the motor by closing DPST switch.
3) Move the 3-point starter handle form ‘OFF’ to ‘ON’ position slowly and motor starts running.
4) Adjust the speed of the motor to rated value by the adjusting the field rheostat of
motor.
5) By using field rheostat vary the field current of generator.
6) By varying the field current in steps note down all the readings of generated voltage at
constant speed.
7) Now the field current & field rheostat of motor is removed slowly and the power is switched
OFF.
TABULAR COLUMN:
Residual Voltage = Speed=
SNO If(A) Eg(V)
28
EEE LAB MANUAL MRCET
MODEL GRAPH:
Draw the graph between generated voltage at no load and field current. By taking
Generated voltage Eg in volts on Y axis and field current If in amps on X-axis.
PRECAUTIONS:-
1) The rheostat is connected such that minimum resistance is included in field circuit of motor.
2) The rheostat is connected such that maximum resistance is included in field circuit of
generator.
3) Starter handle is moved slowly.
RESULT:
QUESTIONS:
1.What is meant by critical field resistance?
2. What is meant by critical speed?
3. Residual magnetism is necessary for self excited generators or not.
4.Why this test is conducted at constant speed.
29
EEE LAB MANUAL MRCET
SECTION-B
30
EEE LAB MANUAL MRCET
AIM:
1. To draw the input and output characteristics of transistor connected in CE
configuration.
2. To find β of the given transistor and also its input and output Resistances.
CIRCUIT DIAGRAM:
THEORY:
In common emitter configuration, input voltage is applied between base and emitter terminals
and out put is taken across the collector and emitter terminals. Therefore the emitter terminal is
common to both input and output.
The input characteristics resemble that of a forward biased diode curve. This is expected
since the Base-Emitter junction of the transistor is forward biased. As compared to CB
arrangement IB increases less rapidly with VBE. Therefore input resistance of CE circuit is
higher than that of CB circuit.
The output characteristics are drawn between Ic and VCE at constant IB. the
collector current varies with VCE upto few volts only. After this the collector current becomes
almost constant, and independent of VCE. The value of VCE up to which the collector current
31
EEE LAB MANUAL MRCET
changes with V CE is known as Knee voltage. The transistor always operated in the region
above Knee voltage, IC is always constant and is approximately equal to IB.The current
amplification factor of CE configuration is given by
β = ΔIC/ΔIB
Input Resistance, ri = ∆VBE /∆IB (μA) at Constant VCE
Output Résistance, ro = ∆VCE /∆IC at Constant IB (μA)
PROCEDURE:
A) INPUT CHARECTERSTICS:
B) OUTPUT CHARACTERSTICS:
1. Connect the circuit as per the circuit diagram.
2. for plotting the output characteristics the input current IB is kept constant at 50μA and
for different values of VCC note down the values of IC and VCE
3. Repeat the above step by keeping IB at 75 μA and 100 μA and tabulate the all the
readings.
4. plot the graph between VCE and IC for constant IB.
32
EEE LAB MANUAL MRCET
MODEL GRAPHS:
A) INPUT CHARACTERISTICS:
B) OUTPUT CHARACTERSITICS:
OBSERVATIONS:
A) INPUT CHARACTERISTICS:
33
EEE LAB MANUAL MRCET
B) OUTPUT CHAREACTARISTICS:
IB = 50 μA IB = 75 μA IB = 100 μA
S.NO
VCE(V) IC(mA) VCE(V) IC(mA) VCE(V) IC(mA)
PRECAUTIONS:
1. The supply voltage should not exceed the rating of the transistor
2. Meters should be connected properly according to their polarities
RESULT:
QUESTIONS:
34
EEE LAB MANUAL MRCET
AIM: To Examine the input and output waveforms of Full Wave Rectifier and also calculate
its load regulation and ripple factor.
1. with Filter
2. without Filter
35
EEE LAB MANUAL MRCET
MODEL WAVEFORMS:
A) INPUT WAVEFORM
36
EEE LAB MANUAL MRCET
THEORY:
The circuit of a center-tapped full wave rectifier uses two diodes D1&D2. During
positive half cycle of secondary voltage (input voltage), the diode D1 is forward biased and
D2is reverse biased. So the diode D1 conducts and current flows through load resistor RL.
During negative half cycle, diode D2 becomes forward biased and D1 reverse biased.
Now, D2 conducts and current flows through the load resistor RL in the same direction. There is
a continuous current flow through the load resistor R L, during both the half cycles and will get
unidirectional current as show in the model graph. The difference between full wave and half
wave rectification is that a full wave rectifier allows unidirectional (one way) current to the
load during the entire 360 degrees of the input signal and half-wave rectifier allows this only
during one half cycle (180 degree).
THEORITICAL CALCULATIONS:
Vrms = Vm/ √2
Vm =Vrms√2
Vdc=2Vm/П
(i)Without filter:
Ripple factor, r = √ (Vrms/ Vdc )2 -1 = 0.812
(ii)With filter:
Ripple factor, r = 1/ (4√3 f C RL)
PROCEDURE:
1. Connections are made as per the circuit diagram.
2. Connect the ac mains to the primary side of the transformer and the secondary side to
the rectifier.
3. Measure the ac voltage at the input side of the rectifier.
4. Measure both ac and dc voltages at the output side the rectifier.
5. Find the theoretical value of the dc voltage by using the formula Vdc=2Vm/П
6. Connect the filter capacitor across the load resistor and measure the values of Vac and
Vdc at the output.
7. The theoretical values of Ripple factors with and without capacitor are calculated.
8. From the values of Vac and Vdc practical values of Ripple factors are calculated. The
practical values are compared with theoretical values.
37
EEE LAB MANUAL MRCET
PRECAUTIONS:
1. The primary and secondary side of the transformer should be carefully identified.
2. The polarities of all the diodes should be carefully identified.
RESULT:
QUESTIONS:
38
EEE LAB MANUAL MRCET
CIRCUIT DIAGRAM:
39
EEE LAB MANUAL MRCET
THEORY:
The CE amplifier provides high gain &wide frequency response. The emitter lead is
common to both input & output circuits and is grounded. The emitter-base circuit is forward
biased. The collector current is controlled by the base current rather than emitter current. When
a transistor is biased in active region it acts like an amplifier. The input signal is applied to base
terminal of the transistor and amplifier output is taken across collector terminal. A very small
change in base current produces a much larger change in collector current. When positive half-
cycle is fed to the input circuit, it opposes the forward bias of the circuit which causes the
collector current to decrease; it decreases the voltage more negative. Thus when input cycle
varies through a negative half-cycle, increases the forward bias of the circuit, which causes the
collector current to increases thus the output signal is common emitter amplifier is in out of
phase with the input signal. An amplified output signal is obtained when this fluctuating
collector current flows through a collector resistor Rc.
The capacitor across the collector resistor Rc will act as a bypass capacitor. This will improve
high frequency response of amplifier.
PROCEDURE:
1. Connect the circuit as shown in circuit diagram
2. Apply the input of 20mV peak-to-peak and 1 KHz frequency using Function Generator
3. Measure the Output Voltage Vo (p-p) for various load resistors.
4. Tabulate the readings in the tabular form.
5. The voltage gain can be calculated by using the expression , Av= (V0/Vi)
6. For plotting the frequency response the input voltage is kept Constant at 20mV peak-to-
peak and the frequency is varied from 100Hz to 1MHz Using function generator
7. Note down the value of output voltage for each frequency.
8. All the readings are tabulated and voltage gain in dB is calculated by Using The expression
Av=20 log10 (V0/Vi)
9. A graph is drawn by taking frequency on x-axis and gain in dB on y-axis On Semi-log
graph.
10.The band width of the amplifier is calculated from the graph Using the expression,
Bandwidth, BW=f2-f1
40
EEE LAB MANUAL MRCET
MODELWAVE FORMS:
FREQUENCY RESPONSE
41
EEE LAB MANUAL MRCET
OBSERVATIONS:
INPUT VOLTAGE, Vi =20MV
RESULT:
QUESTIONS:
42
EEE LAB MANUAL MRCET
APPARATUS:
Name Quantity
Resistors(100k,20k,4k,1k) 4no
Transistors(2N2222A) 1no
CRO 1no
RPS 1no
DESIGN PROCEDURE:
a) Let R = 10K
1 RC
fr When K
2 RC 6 4 K R
1
C
4K
2 10 K 6 K 6 4
10 K
0.962nF 1nF ( Select s tan dard )
R 10K ; C 1nF
29
b) hfe 23 4 K for sustained oscillatio n
K
97.1
43
EEE LAB MANUAL MRCET
CIRCUIT DIAGRAM:
VCC
12V
VCC
R1
R3
100kohm
4kohm
C2
XSC1
10
C1
A
10uF
Q2
B
4 12
10uF 2N2222A
G
T
C3
R2 11 100uF
R4
22kohm
1kohm
C6 C5 C4
PROCEDURE: Rig up the circuit using multisim software and verify the results using
Oscilloscope.
44
EEE LAB MANUAL MRCET
RESULT:
QUESTIONS:
45
EEE LAB MANUAL MRCET
AIM: To study the operation of Class A, Class B, Class AB and Class C power amplifiers.
EQUIPMENT:
1. Class/A/B/C/AB amplifier trainer.
2. Function generator.
3. C.R.O
4. Connecting patch cords.
CIRCUIT DIAGRAM:
46
EEE LAB MANUAL MRCET
PROCEDURE:
1. Connect the circuit as shown in the circuit diagram, and get the circuit verified by your
Instructor.
2. Connect the signal generator with sine wave at 1KHz and keep the
Amplitude at .5V (peak-to-peak)
3. Connect the C.R.O across the output terminals.
4. Now switch ON the trainer and see that the supply LED glows.
5. Keep the potentiometer at minimum position, observe and record
the waveform from the C.R.O.
6. Slowly varying the potentiometer, observe the outputs for the
Class A/B/AB/C amplifiers as shown in fig.
CLASS A:
RESULT:
47
EEE LAB MANUAL MRCET
MICROPROCESSOR
48
EEE LAB MANUAL MRCET
ASSEMBLER
An assembler program is used to translate the assembly language mnemonics for
instructions to the corresponding binary codes. When you run the assembler, it reads the source
file of your program the disk, where you saved it after editing on the first pass through the source
program the assembler determines the displacement of named data items, the offset of labels and
pails 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 offset etc that is
calculated during the first pass. The assembler generates two files on floppy or hard disk. The
first file called the object file is given the extension. OBJ. The object file contains the binary
codes for the instructions and information about the addresses of the instructions. The second file
generated by the assembler is called assembler list file. The list file contains your assembly
language statements, the binary codes for each instructions and the offset for each instruction. In
MASM/TASM assembler, MASM/TASM source file name ASM is used to assemble the file.
Edit source file name LST is used to view the list file, which is generated, when you assemble
the file.
LINKER
A linker is a program used to join several object files into one large object file and
convert to an exe file. The linker produces a link file, which contains the binary codes for all the
combined modules. The linker however doesn’t assign absolute addresses to the program, it
assigns is said to be relocatable because it can be put anywhere in memory to be run. In
MASM/TASM, LINK/TLINK source filename is used to link the file.
DEBUGGER
A debugger is a program which allows you to load your object code program into system
memory, execute the program and troubleshoot are debug it 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 register and memory locations after your program runs. It allows you to change
the contents of register and memory locations and return the program. A debugger also allows
you to set a break point at any point in the program. If you inset a breakpoint the debugger will
run the program upto the instruction where the breakpoint is set and stop execution. You can
then examine register and memory contents to see whether the results are correct at that point. In
MASM/TASM, td filename is issued to debug the file.
DEBUGGER FUNCTIONS:
1. Debugger allows to look at the contents of registers and memory locations.
2. We can extend 8-bit register to 16-bit register which the help of extended register option.
3. Debugger allows to set breakpoints at any point with the program.
49
EEE LAB MANUAL MRCET
4. The debugger will run the program upto the instruction where the breakpoint is set and
then stop execution of program. At this point, we can examine registry and memory
contents at that point.
5. With the help of dump we can view register contents.
6. we can trace the program step by step with the help of F7.
7. We can execute the program completely at a time using F8.
DEBUGGER COMMANDS
ASSEMBLE: To write assembly language program from the given address.
R register name
Eg: r ax
50
EEE LAB MANUAL MRCET
UDT-1.1
1. Open an MSDOS window.
2. Set the PATH so that the MASM programs are available
The MASM programs are on the C drive; set the path so that DOS can find them. This only
needs to be done once each time you open an MSDOS prompt.
set PATH=%PATH%;C:\MASM\BIN
3. Use a Text Editor to Edit the .ASM FileUDT-1.2
Create your file using one of the following programs:
notepad proj.asm
wordpad proj.asm
edit proj.asm
UDT-1.3
4. Compile the source code to create an object module.
tasm/z/zi proj.asm
The /z switch causes MASM to display the lines that generate compilation errors. The /zi switch
enables information needed by the debugger to be included in the .OBJ file. Note that you should
use "real mode" assembler, MASM.EXE. Do not use the "protected mode" assembler
MASM32.EXE for the assignments that will be given in class
UDT-1.4
5. Run Linker LINK.EXE- generate .EXE file from the .OBJ file
tlink/v proj
6. Run the Program
Your final program (if there were no errors in the previous step) will have an .EXE ending. To
just run it, type:
proj
If you want to use the debugger to examine the instructions, registers, etc., type:
td proj
This brings up the regular full-screen version of the Turbo debugger.
51
EEE LAB MANUAL MRCET
UDT 1.5
1. Tracing the Program's Execution
The Turbo debugger first starts, a Module Window which displays the . Executable lines of
program code, marked with a bullet in the left column of the window. You can set breakpoints
or step to any of these lines of code. An arrow in the first column of the window indicates the
location of the instruction pointer. This always points to the next statement to be executed. To
execute just that instruction use one of the two methods listed under the Run menu item:
o Trace into (can use F7 key): executes one instruction; traces "into" procedures.
o Step over (can use F8 key): executes one instruction; skips (does not trace into) procedures.
Hitting either of these executes the instruction, and moves the arrow to the next instruction. As
each instruction executes, the effects might be visible in the Registers Window and Watches
Window
UDT 1.6
o Trace into (can use F7 key): executes one instruction; traces "into" procedures.
o Step over (can use F8 key): executes one instruction; skips (does not trace into) procedures.
Hitting either of these executes the instruction, and moves the arrow to the next instruction. As
each instruction executes, the effects might be visible in the Registers Window and Watches
Window
UDT 1.7
2. Setting and Removing Breakpoints
To set a breakpoint, position the cursor on the desired line of source code and press F2. The line
containing the breakpoint will turn red. Pressing F2 again removes the breakpoint. To execute all
instructions from the current instruction pointer up to the next encountered breakpoint, choose
Run (can use F9 key) from the Run menu item.
UDT 1.8
3. Examining Registers
Another window, the Registers Window, can be opened to examine the current value of the CPU
registers and flags. The View menu can be used to open this Registers Window. The registers
and flags might change as each instruction is executedUDT 1.9
4. Examining Memory
To examine memory, you will need to open an Inspector window. An Inspector window shows
the contents of a data structure (or simple variable) in the program you are debugging. It also
allows you to modify the contents of the data structure or variable. To open an Inspector
window, place the cursor on what you want to inspect and press CTRL-I. After you've examined
the data item, press the ESC key to remove the Inspector window
UDT 1.10
52
EEE LAB MANUAL MRCET
SOFTWARE REQUIRED:
1. Pc with windows(95/98/XP/NT/2000)
2. MASM SOFTWARE
PROGRAMS:
(A) 16-BIT ADDITION
.MODEL TINY
DATA SEGMENT
NUM1 DW 23C5H
NUM2 DW 6789H
DATA ENDS
EXTRA SEGMENT
RESULT DW 0000H
EXTRA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:EXTRA
START: MOV AX,DATA
MOV DS,AX
MOV AX,EXTRA
MOV ES,AX
SUB AX,AX
MOV AX, NUM1
MOV BX, NUM2
ADD AX,BX
MOV DI,OFFSET RESULT
MOV [DI],AX
MOV RESULT,AX
INT 3H
CODE ENDS
END START
RESULT:
53
EEE LAB MANUAL MRCET
.MODEL TINY
DATA SEGMENT
NUM1 DW 23C5H
NUM2 DW 1789H
RESULT DW 0000H
DATA ENDS
EXTRA SEGMENT
RESULT DW 0000H
EXTRA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:EXTRA
START: MOV AX,DATA
MOV DS,AX
MOV AX,EXTRA
MOV ES,AX
SUB AX,AX
MOV AX, NUM1
MOV BX, NUM2
SUB AX,BX
MOV DI,OFFSET RESULT
MOV [DI],AX
MOV RESULT,AX
INT 3H
CODE ENDS
END START
RESULT:
.MODEL TINY
DATA SEGMENT
NUM1 DW 23C5H
54
EEE LAB MANUAL MRCET
NUM2 DW 1789H
DATA ENDS
EXTRA SEGMENT
RESULT DW 0000H
EXTRA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:EXTRA
START: MOV AX,DATA
MOV DS,AX
MOV AX,EXTRA
MOV ES,AX
SUB AX,AX
MOV AX, NUM1
MOV BX, NUM2
MUL AX,BX
MOV DI,OFFSET RESULT
MOV [DI],AX
MOV RESULT,AX
INT 3H
CODE ENDS
END START
RESULT:
55
EEE LAB MANUAL MRCET
AIM: To Write and execute an Assembly language Program (ALP) to 8086 processor to divide a
32 bit unsigned number by a 16 bit unsigned numbers. Store the result in stack segment.
SOFTWARE REQIRED:
1. Pc with windows(95/98/XP/NT/2000)
2. MASM SOFTWARE
PROGRAMS:
MODEL SMALL
DATA SEGMENT
NUM1 DD 4096H
NUM2 DW 1024H
DATA ENDS
STACK SEGMENT
RESULT DW ?
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK
START: MOV AX,DATA
MOV DS,AX
MOV AX,STACK
MOV SS,AX
SUB AX,AX
MOV SI,OFFSET NUM1
MOV AX,[SI]
INC SI
INC SI
MOV DX,[SI]
MOV BX, NUM2
DIV BX
LEA BP,RESULT
MOV [BP],AX
INC BP
MOV [BP],DX
INT 3H
CODE ENDS
END START
56