MPMC Manual
MPMC Manual
Experiment no - 1
INTRODUCTION TO TASM
EXP.NO:- DATE:-
ASSEMBLY LANGUAGE PROGRAMMING USING TASM SOFTWARE
The programs are written using assembly language in editor then compile it. The
complier converts assembly language statements into machine language
statements/checks for errors. Then execute the compiled program.
MERITS OF MASM:
Z:\TASM\
Then the path is Z: \>
After writing the program, save the file name with .asm extension
After save the file, click on file menu then go to exit then exit from the editor and go to
prompt
After that type „R‟ displays there glisters contents and starting step of the program.
HEX H value1 value2 ; Add and subtract two Hex values INPUT I port
QUIT Q
REGISTER R [register]
TRACE T [=address][value]
UN ASSEMBLE U [range]
Flow chart:-
Start
Move 00H to AH
Program interrupt
Stop
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
ASSUME CS: CODE, DS: DATA
DATA SEGMENT
N1 DB 09H
N2 DB 07H
N3 DB 06H
RESULT DB ?
DATA ENDS
CODE SEGMENT
START:
MOV AX, DATA
MOV DS, AX
MOV AL, 00H
MOV AL, N1
ADD AL, N2
ADD AL, N3
DAA
MOV RESULT, AL
MOV AH, 4CH
INT 21H
CODE ENDS
END START
RESULT:
Flow chart: -
Start
Multiplication of BX contents
Division of BX is performed
END
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
ASSUME CS: CODE, DS: DATA
DATA SEGMENT
N1 DW 0004H
N2 DW 0002H
RESULT DW ?
DATA ENDS
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
MOV AX, N1
MOV BX, N2
MUL BX
MOV RESULT, AX
MOV [RESULT+1], BX
DIV BX
MOV [RESULT+2], AX
MOV [RESULT+3], BX
INT 21H
CODE ENDS
END START
RESULT:
Experiment no: - 2
Increment SI
YES
If carry
equal to 0
NO
Oo
Exchange the contents of AL & SI
Increment SI
NO
Decrement
CX
If CX =0 YES
NO
Decrement
DX
YES
If DX=0
Stop
EXP.NO:-2 DATE:-
SORTING OF „N‟ NUMBERS
ABSTRACT: Assembly language program to do sorting of numbers in a given series
PORT USED: None
REGISTERS USED: CX, DX, AL, SI
ALGORITHM:
Step1: Start
Step2: Initialize data segment
Step3: Load CX register with count
Step4: Copy the contents from CX to DX
Step5: Load SI with offset list
Step6: Copy the contents from DX to CX
Step7: Move the contents from memory location SI to AL
Step8: Increment SI
Step9: Compare AL contents with [SI]
Step10: Jump to step15 if carry
Step11: Exchange the contents of AL with [SI]
Step12: Decrement SI
Step13: Move the contents from AL to memory location SI
Step14: Increment SI
Step15: Decrement CX and jump to step7 if no zero
Step16: Decrement DX and jump to step5 if no zero
Step17: Stop.
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
ASSUME CS: CODE, DS: DATA
DATA SEGMENT
LIST DB 56H, 12H, 72,32H
COUNT EQU 0003H
DATA ENDS
CODE SEGMENT
ORG 1000H
START: MOV AX, DATA
MOV DS, AX
MOV CX, COUNT
MOV DX, CX
AGAIN: MOV SI, OFFSET LIST
MOV CX, DX
BACK: MOV AL, [SI]
INC SI
CMP AL, [SI]
JC NEXT
XCHG [SI], AL
DEC SI
MOV [SI], AL
INC SI
NEXT: LOOP BACK
DEC DX
JNZ AGAIN
MOV AH, 4CH
INT 21H
CODE ENDS
END START
RESULT:
Experiment no: - 3
PROGRAMS FOR FACTORIAL OF
GIVEN N - NUMBERS
Flow chart: -
Start
Multiply Contents of CX
Decrement of CX
END
EXP.NO:-3 DATE:-
PROGRAMS FOR FACTORIAL OF GIVEN N - NUMBERS
ABSTRACT: Assembly language program to perform factorial of given n-numbers
using 8086 TASM software.
PORT USED: None
REGISTERS USED: AX, CX
ALGORITHM:
Step 1: Start
Step 2: Initialize data segment
Step 3: Initialize AX and CX register values to zero
Step 4: Increment the content of AX register
Step 5: Copy the given number into CL register
Step 6: Compare the contents of CL register with 01H
Step 7: Jump if equal to step 10
Step 8: Multiply the contents of AX register with CL register
Step 9: Decrement CX and jump to step 8 if no zero
Step 10: Store the result to the data memory
Start 11: Stop.
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
ASSUME CS: CODE, DS: DATA
DATA SEGMENT
NUM DB 08H
FACT DW ?
DATA ENDS
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
MOV AX, 0001H
MOV CX, 0000H
MOV CL, NUM
BACK: MUL CX
DEC CX
JNZ BACK
MOV AH, 4CH
INT 21H
CODE ENDS
END START
RESULT:
Experiment no: - 4
EXP.NO:-4 DATE:-
INTERFACE ANALOG – TO - DIGITAL CONVERTER TO 8086
AIM: - To write alp to interface ADC with 8086.
APPARATUS:
Microprocessor power supply kit
Microprocessor kit
ADC module
Key board
ALGORITHM:
Copy address of control word register of 8255 ppi to one of general-purpose
register.
Copy the control word of 91H to the accumulator.
Load the control word into cwr of 8258 to make the port a, port c (or) input.
Send out the number of 67H to port B to output enable to clear previous
output.
Start the conversion by send the Hexadecimal number of 87H to port-b and
then reset by send 04H E7H Hexadecimal number to port b.
Send continuously check the port c lower bit pc to check conversion is
ended.
PROCEDURE:
Switch on the kit (reset the trainer ALSSDA86-STA)
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
MOV AX, 0000
MOV AL, 98H
MOV DX, OFFC6H
OUT DX, AL
MOV AL, 02
MOV DX, OFFC2
OUT DX, AL
MOV AL, 00
MOV DX, OFFC4
OUT DX, AL
MOV AL, 01
MOV DX, OFFC4
OUT DX, AL
WAIT: MOV DX, OFFC4
IN AL, DX
MOV CL, D1
RCL AL, CL
JNC WAIT
MOV DX, OFFCO
IN AL, DX
INT 03
RESULT:
Experiment no: - 5
INTERFACING DIGITAL - TO -
ANALOG CONVERTER TO 8086
Flow chart: -
Start
Stop
EXP.NO:-5 DATE:-
INTERFACING DIGITAL - TO - ANALOG CONVERTER TO 8086
GENERATION OF WAVE FORMS:
AIM: program to generate the following wave forms:
Triangular wave forms
Saw tooth wave forms
Square wave
Sine wave
REGISTERS USED: general purpose registers: AL, DX, and CX
PORTS USED: out (port-B)
CONNECTION: J4 of ESA 86/88 to J1 DAC interface.
DESCRIPTIONS: As can be from the circuit only 17 lines from the connector are
used totally. The port A and port B of 8255 programmable peripheral interface are
used as output ports. The digital inputs to the DAC‟s are provided through the port
A and port B of 8255.the analog outputs of the DAC‟s are connected to the inverting
inputs of op-amps µA741 which acts as current to voltage converters. The out puts
from the op- amps are connected to points marked Xout and Yout at which the wave
forms are observed on a CRO. (port A is used to control Xout port B is used to control
Yout).the difference voltage for the DAC‟s is derived from an on-board voltage
regulator µA 723 .it generates a voltage of about 8V.the offset balancing of the op-
amps is done by making use of the two 10k pots provided. The output wave forms
are observed at Xout and Yout on an oscillator.
THEORY:
BASIC DAC TECHNIQUE:
Vo = K VFS (d1 .2-1 + d2 . 2-2 + . . . . . . . .+dn . 2-n )
Where d1 = MSB, d2 = LSB
VFS = Full scale reading / out put voltage
K --- Conversion factor is adjusted to „unity‟.
D/A converters consist of „n‟ bit binary word „D‟and is combined with a reference
voltage VR to give an analog output. The out put can be either voltage or current
Out put voltage Vo = K VFS (d1 .2-1 + d2. 2-2 + . . . . . . . . +dn. 2-n)
PROGRAM: -
MOV AL, 88
OUT DX, AL
MOV AL, 00
CALL 4013
CAL 4013
JMP 4006
OUT DX, AL
CALL 40FF
RET
LOOP 4022
RET
Experiment no: - 6
INTERFACING STEPPER MOTOR TO
8086
FLOW CHART:
Start
Skip
Increment the R2
Decrement R1
END
EXP.NO:-6 DATE:-
INTERFACING STEPPER MOTOR TO 8086
ABSTRACT: C language program to do stepper motor interface
APPARATUS: A personal computer with keil software.
PROGRAM:
# include < reg.A5.h >
# include < studio.h >
Void delay (void);
8 bit motor_ pin _1 = p2^ 6;
8 bit motor_ pin _2 = p2^ 7;
Void main ()
{
Do
{
Motor _ pin _ 1= 1;
Motor _pin _ 2 = 0; // Rotates motor anti clock wise
Delay ();
Motor _ pin _ 1= 1;
Motor _ pin _ 2= 1; // stops motor
Delay ();
Motor _ pin _ 1 = 0;
Motor _ pin _ 2= 1; // rotates motor clock wise
Delay ();
Delay ();
}
While (1);
}
Void delay ()
{
Int I,j ;
For ( I>0; I= 500; I++)
{
For ( j= 0; j= 7000; j++)
{
}
}
}
PROCEDURE:
Start computer & open keil software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Add source file to the source group.
Build target and rebuild the target.
Observe the results in peripherals in the peripheral window.
RESULT:
Experiment no: - 7
FINDING NUMBER OF 1‟S AND
NUMBER OF 0‟S IN A GIVEN 8 – BIT
NUMBER
FLOW CHART:
Start
END
EXP.NO:-7 DATE:-
Physical Address
Mnemonic
Segment Offset Label Hex Code Comments
Operands
Address Address
PROGRAM:
ORG 000H
JMP MAIN
ORG 40H
MAIN: MOV R0, #12
MOV R1, #08
MOV A, R0
LOOP: RLC A
JC LABEL 1
INC R2
SJMP LABEL 2
LABEL1: INC R3
LABEL2: DJNZ R1, LOOP
END
PROCEDURE:
Start computer & open keil C software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Add source file to the source group.
Build target and rebuild the target.
Observe the results in peripherals in the peripheral window.
RESULT:
Experiment no: - 8
AVERAGE OF N - NUMBERS
EXP.NO:-8 DATE:-
FIND AVERAGE OF N - NUMBERS
AIM: To write assembly language program to find average of N numbers
APPARATUS: A Personal computer with keil c software.
ALOGRITHM:
1. Take two numbers from 500h location using DPTR register & send first numbers
into R0 register through a register.
2. Assign count value to R1 register.
3. Move and count value into B register through A register.
4. Move second number in to A register.
5. This operation is continued till count value is equal to zero offer that R0 value is
moved to n register.
6. Divide the A register value with B the result is stored in 600h location.
PROGRAM:
MOV R0, #50H
MOV A, @R0
MOV R2, A
MOV R1, #60H
INC R0
BACK: MOV A, @R0
ADD A, R2
MOV R2, A
INC R0
DJNZ R1, BACK
MOV B, #06H
DIV AB
MOV 60H, A
MOV 60H, B
END
PROCEDURE:
Start computer & open keil c software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Add source file to the source group.
Build target and rebuild the target.
Observe the results in peripherals in the peripheral window.
RESULT:
Experiment no: - 9
EXP.NO:-9 DATE:-
PROGRAM AND VERIFY TIMER/COUNTER IN 8051
AIM: To verify the operation of timer/counter
APPARATUS REQUIRED: A personal computer with Keil c Assembler
THEORY:
The 8051 has two timers/counters. They can be used either as timers to generate a
time delay or as counters to count events happening outside the microcontroller.
PROGRAMMING 8051 TIMERS:
The 8051 has two timers: Timer 0 and Timer 1. They can be used either as timers or
as event counters. In this section we first discuss the timers‟ registers and then
show how to program the timers to generate time delays.
BASIC REGISTERS OF THE TIMER:
Both Timer 0 and Timer 1 are 16 bits wide. Since the 8051 has an 8-bit
architecture, each 16-bit timer is accessed as two separate registers of low byte and
high byte. Each timer is discussed separately.
TIMER 0 REGISTERS:
The 16-bit register of Timer 0 is accessed as low byte and high byte. The low byte
register is called TLO (Timer 0 low byte) and the high byte register is referred to as
THO (Timer 0 high byte). These registers can be accessed like any other register,
such as A, B, RO, Rl, R2, etc. For example, the instruction “MOV TLO , #4FH”
moves the value 4FH into TLO, the low byte of Timer 0. These registers can also be
read like any other register. For example, “MOV R5 , THO” saves THO (high byte of
Timer 0) in R5.
Timer 0 Registers
Timer 1 registers
TIMER 1 REGISTERS:
Timer I is also 16 bits, and its 16-bit register is split into two bytes, referred to as
TLl (Timer I low byte) and TH1 (Timer 1 high byte). These registers are accessible in
the same way as the registers of Timer 0.
TMOD (TIMER MODE) REGISTER:
Both timers 0 and 1 use the same register, called TMOD, to set the various timer
operation modes. TMOD is an 8-bit register in which the lower 4 bits are set aside
for Timer 0 and the upper 4 bits for Timer 1. In each case, the lower 2 bits are used
to set the timer mode and the upper 2 bits to specify the operation. These options
are discussed next.
PROGRAM:
MOV TMOD, #01;
HERE: MOV TLO, #0F2H;
MOV THO, #0FFH;
CPL P1.5;
ACALL DELAY;
SJMP HERE;
DELAY: SET B TRO;
AGAIN: JNBTFO AGAIN;
CLR TRO;
CLR TFO;
RET
END
OUTPUT:
Experiment no: - 10
EXP.NO:10 DATE:-
TRAFFIC LIGHTS INTERFACE
1.0 INTRODUCTION
Electro Systems Associates Private Limited (ESA) manufactures trainers for
most of the popular microcomputers viz 8085, Z-80, 6502, 8086/8088 and 68000.
ESA offers a variety of modules which can be interfaced to these trainers. These
modules can be effectively used for teaching/training in the laboratories. The
present manual describes one such interface module traffic lights interface. The
interface simulates the control and operation of traffic lights at a junction of four
roads. The interface provides a set of 6 LED indicators at each of the four corners.
Each of these LEDs can be controlled by a port line. Thus the interface allows the
user to simulate a variety of traffic situations using appropriate software routines.
The sample programs provided in section 4 of this manual simulate some
interesting traffic movement sequences. This interface can be connected to any of
ESA trainers viz., MPS 85-3, ESA 85-2, ESA 80, ESA 65, ESA 68K, ESA 86/88-2,
ESA 31, ESA 51, ESA 86/88-3 & ESA 51E.
2.0 DESCRIPTION OF THE CIRCUIT
Please refer to the schematic diagram of this interface presented at the end
of this manual. As already mentioned, the interface provides a set of six LEDs at
each of the four corners of a four road junction. The organization of these LEDs is
identical at each of the four corners. Hence, for simplicity, the organization is
described below with reference to the LEDs at SOUTH-WEST corner only. The LEDs
at SOUTH-WEST corner are organized as follows:
The LEDs at SOUTH-WEST corner are organized as follows:
RED: Referred to as SOUTH RED henceforth
A: Referred to as SOUTH AMBER henceforth
L: Referred to as SOUTH LEFT henceforth
S: Referred to as SOUTH STRAIGHT henceforth
R: Referred to as SOUTH RIGHT henceforth
DL: Referred to as SOUTH PEDESTRIAN henceforth (Please note that DL
refers to a set of two LEDs, one on either side of the road).
Of these , the first five LEDs will be ON or OFF depending on the state of the
corresponding port line (LED is ON if the port line is Logic HIGH and LED is OFF if
the port line is Logic LOW). The last one marked as DL is a set of two dual - color
LEDs and they both will be either RED or GREEN depending on the state of the
corresponding port line (RED if the port line is Logic HIGH and GREEN if the port
line is Logic LOW)
There are four such sets of LEDs and these are controlled by 24 port lines.
Each port line is inverted and buffered using 7406 (open collector inverter buffers)
and is used to control an LED. Dual-colour LEDs are controlled by a port line and
its complement.
The 24 LEDs and their corresponding port lines are summarized below
LED PORT LINE
SOUTH EAST NORTH WEST
RED PA3 PA7 PB3 PB7
AMBER PA6 PA2 PB2 PB6
LEFT PA4 PA0 PB0 PB4
STRAIGHT PC2 PC3 PC1 PC0
RIGHT PA5 PA1 PB5 PB1
PEDISTRIAN PC7 PC6 PC4 PC5
User can assign any meaningful interpretation to these LEDs and then develop
software accordingly. Usually, the interpretation would be as follows:
Vehicles coming from one direction are controlled by the LEDs at the opposite
corner.
For example,
Vehicles coming from NORTH are controlled by the set of LEDs at the SOUTH WEST
corner, as shown below:
Vehicles coming from NORTH can
go left (i.e to EAST) if SOUTH LEFT LED is ON
go right (i.e to WEST) if SOUTH RIGHT LED is ON
go straight (i.e to SOUTH) if SOUTH STRAIGHT LED is ON
Further, the above movements are followed only if SOUTH RED LED is OFF. If
SOUTH RED LED is ON , no movement is allowed for vehicles from north.
No vehicle movement
Pedestrians can cross on all four roads
The system moves from one state to another state after fixed time delay. The state
transition is indicated by turning ON all the AMBER LEDs and all pedestrian red
LEDs for a fixed duration. The sequence of the above states are repeated again and
again. Hence you must press the RESET key to allow the monitor program to regain
control for this program.
PROGRAM:
The traffic system moves from one state to next state after a fixed delay.
# Include <reg52.h>
S BIT RE = P0ˆ0;
S BIT YE = P0ˆ1;
S BIT GE = P0ˆ2;
S BIT RW = P0ˆ3;
S BIT YW = P0ˆ4;
S BIT GW = P0ˆ5;
S BIT RS = P0ˆ6;
S BIT YS = P0ˆ7;
S BIT GS = P2ˆ0;
S BIT RN = P2ˆ1;
S BIT YN = P2ˆ2;
S BIT GN = P2ˆ3;
Void Delay (Void)
{
UNSIGNED INT I, J;
FOR (I=0; I<200; I++)
FOR (J=0; I<500; J++);
}
Void Super Delay ( )
{
UNSIGNED INT I;
FOR (I=0; I<25; I++)
DELAY ( );
}
Void Main ( )
{
P3 = 0;
WHILE (1)
}
RE = 0;
GE = 1;
YE = 0;
GW = 0;
YW = 0;
RW = 1;
RS = 1;
GS = 0;
YS = 0;
RN = 1;
YN = 0;
GN = 0;
Super Delay ( );
YE = 1;
GE = 0;
DELAY ( );
RE = 1;
YE = 0;
GE = 0;
RW = 0;
YW = 0;
GW = 1;
RS = 1;
YS = 0;
GS = 0;
RN = 1;
YN = 0;
GN = 0;
Super Delay ( );
YW = 1;
GW = 0;
Delay ( );
RE = 1;
YE = 1;
GE = 0;
RW = 1;
YW = 0;
GW = 0;
RS = 0;
YS = 0;
GS = 1;
RN = 1;
YN = 0;
GN = 0;
Super Delay ( );
YS = 1;
GS = 0;
Delay ( );
RE = 1;
GE = 0;
YE = 0;
RW = 1;
YW = 0;
GW = 0;
RS = 1;
YS = 0;
GS = 0;
RN = 0;
YN = 0;
GN = 1;
Super Delay ( );
YN = 1;
GN = 0;
Delay ( );
}
}
RESULT:
Experiment no: - 11
EXP.NO:-11 DATE:-
UART OPERATION IN 8051
AIM: To verify the operation of UART operation
APPARATUS REQUIRED: Keil C Assembler
THEORY:
SERIAL COMMUNICATION:
The fastest way of transmitting data, within a microcomputer is parallel
data transfer. For transferring data over long distances, however, parallel data
transmission requires too many wires. For long distance transmission, data is
usually converted from parallel form to serial form so that it can be sent on a
single wire or pair of wires. Serial data received from a distant source is
converted to parallel form and it can be easily transferred on the microcomputer
buses. The types of communication systems are,
1. Simplex
2. Half-duplex
3. Full-duplex
EXP.NO:-12 DATE:-
INTERFACING OF LED TO 8051
AIM: TO write a c program to interface LCD with 8051.
APPARATUS: A personal computer with keil software.
PROGRAM:
#include< reg52.h >
#include < lcd.h >
S bit rs =p1^2;
S bit en =p1^3;
S bit d4 =p1^4;
S bit d5 =p1^5;
S bit d6 =p1^6;
S bit d7 =p1^7;
Void delay control
{
Int j;
Int i;
For (i=0; i<a; i++)
{
For (j=0; j<100; j++)
{
}
}
Void main ( )
{
Int I;
Lcd4_init ( );
While (1)
{
Lcd4_set_cursor (1, 1);
Lcd4_write_string (“electronics & communications”);
Experiment no: - 13
WRITE AN ASSEMBLY LANGUAGE
PROGRAM TO MULTIPLY OF TWO
16 – BIT BINARY NUMBERS
EXP.NO:-13 DATE:-
MULTIBYTE MULTIPLICATION
AIM: To perform multiplication of two words of signed and unsigned numbers and
observe the result after executions.
ALGORITHM:
1. Get 1st operand from memory that is pointed by source index [SI] register and
store it in AX register.
2. Get 2nd operand from memory and store it in BX register.
3. Multiply contents of AX and BX registers and the result will be in AX & DX
registers.
4. Store the result in memory location pointed by DI.
PROGRAM:
MOV AX,0000
MOV DX,0000
MOV SI,2100
MOV DI,2200
MOV AX,[SI]
INC SI
INC SI
MOV BX, [SI]
MUL BX
MOV [DI], AX
INC DI
INC DI
MOV [DI], DX
INT 03
PROCEDURE:
Start computer & open keil C software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Experiment no: - 14
WRITE AN ASSEMBLY LANGUAGE PROGRAM
TO FIND THE SUM OF FIRST 10 INTEGERS
NUMBERS
EXP.NO:- 14 DATE:-
FIND THE SUM OF FIRST 10 INTEGERS NUMBERS
AIM: To write an assembly program to find the sum of first 10 integers numbers.
APPARATUS: A Personal computer with keil C software.
PROCEDURE:
Start computer & open keil C software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Add source file to the source group.
Build target and rebuild the target.
Observe the results in peripherals in the peripheral window.
PROGRAM:
Area addition, CODE, READONLY
ENTRY
START
MOV r0, #10
MOV r1, r0
ADDIT
SUBS r1, r1, #1
CMP r1, #0
BEQ STOP
ADD r3, r0, r1
MOV r0, r3
BNE ADDIT
STOP
NOP
NOP
NOP
END
RESULT:
Experiment no: - 15
WRITE A PROGRAM TO TOGGLE
LED EVERY SECOND USING TIMER
INTERRUPT
EXP.NO:-15 DATE:-
LED INTERFACING
AIM: To write a program to interface led with 8051.
APPARATUS: A personal computer with keil C software.
PROGRAM:
#include<reg52.h>
8 bit led_pin =P1^1;
8 bit switch pin=P1^0;
Void delay (int);
Void main (void);
{
Switch_pin=1;
Led_pin=1;
While (1)
{
If (switch_pin==0)
{
Led_pin=0;
Delay (100)
Led_pin=1;
}
}
}
Void delay (int t)
{
Int j;
Int I;
For (i=0;i<k;i++)
{
For (j=0;j<100;j++)
{
}
}
}
PROCEDURE:
Start computer & open keil C software.
Create new micro vision project & click on file -> new.
Write the code & save it.
Add source file to the source group.
Build target and rebuild the target.
Observe the results in peripherals in the peripheral window.
RESULT: