Showing posts with label programs. Show all posts
Showing posts with label programs. Show all posts
Handwritten Notes for Discrete Mathematics and Digital Electronics - WASE Open Exam
Handwritten Notes for Discrete Mathematics and Digital Electronics specially for WASE Open Book exams.
Download:
DS Written Notes
Microprocessor Handwritten Programs
See Similar Posts:
Download:
DS Written Notes
Microprocessor Handwritten Programs
Download --> Print ---> Take ---> Copy it in exam... :D
See Similar Posts:
WASE - Microprocessor Programs
Microprocessor Programs
like :
Addition,
Subtraction,
Display Messaging,
Multiplication,
Division,
Square,
etc...
Click to Download
Click here for 8086 Assembly Language Programming

See Similar Posts:
WASE Open Book Exams - C Programs
Open Book Exams start from June, 2012 .
So, get ready for that.
C Programs are not so easy and not so difficult.
but we have to prepare for that...
Click to Download C Programs
See Similar Posts:
Implementation of Arrays in C
WASE - Semester 1 - C Programs
/*C: Program to implement an array. */
/*C: Program to implement an array. */
#include
<stdio.h>
#include
<conio.h>
#define
MAX 5
void
insert ( int *, int pos, int num ) ;
void
del ( int *, int pos ) ;
void
reverse ( int * ) ;
void
display ( int * ) ;
void
search ( int *, int num ) ;
void
main( )
{
int arr[5] ;
clrscr( ) ;
insert ( arr, 1, 11 ) ;
insert ( arr, 2, 12 ) ;
insert ( arr, 3, 13 ) ;
insert ( arr, 4, 14 ) ;
insert ( arr, 5, 15 ) ;
printf ( "\nElements of Array:
" ) ;
display ( arr ) ;
del ( arr, 5 ) ;
del ( arr, 2 ) ;
printf ( "\n\nAfter deletion:
" ) ;
display ( arr ) ;
insert ( arr, 2, 222 ) ;
insert ( arr, 5, 555 ) ;
printf ( "\n\nAfter insertion:
" ) ;
display ( arr ) ;
reverse ( arr ) ;
printf ( "\n\nAfter reversing:
" ) ;
display ( arr ) ;
search ( arr, 222 ) ;
search ( arr, 666 ) ;
getch( ) ;
}
/*
inserts an element num at given position pos */
void
insert (int *arr, int pos, int num )
{
/* shift elements to right */
int i ;
for ( i = MAX - 1 ; i >= pos ;
i-- )
arr[i] = arr[i - 1] ;
arr[i] = num ;
}
/*
deletes an element from the given position pos */
void
del ( int *arr, int pos )
{
/* skip to the desired position */
int i ;
for ( i = pos ; i < MAX ; i++ )
arr[i - 1] = arr[i] ;
arr[i - 1] = 0 ;
}
/*
reverses the entire array */
void
reverse ( int *arr )
{
int i ;
for ( i = 0 ; i < MAX / 2 ; i++ )
{
int temp = arr[i] ;
arr[i] = arr[MAX - 1 -
i] ;
arr[MAX - 1 - i] = temp
;
}
}
/*
searches array for a given element num */
void
search ( int *arr, int num )
{
/* Traverse the array */
int i ;
for ( i = 0 ; i < MAX ; i++ )
{
if ( arr[i] == num )
{
printf (
"\n\nThe element %d is present at %dth position.", num,
i
+ 1 ) ;
return ;
}
}
if ( i == MAX )
printf ( "\n\nThe
element %d is not present in the array.", num ) ;
}
/*
displays the contents of a array */
void
display ( int *arr )
{
/* traverse the entire array */
int i ;
printf ( "\n" ) ;
for ( i = 0 ; i < MAX ; i++ )
printf (
"%d\t", arr[i] ) ;
}
Microprocessor 8085 Programs
1) Add Positive Nos.
LXI H, 2100
MVI B, 0
MVI D, FF
MVI C, 5
START: MOV A, M
RLC JC
NEXT
RRC
ADD B
CMP D
JC END
MOV B,
A
NEXT: INX H
DCR C
JNZ
START
END: STA 2000
HLT
2) Bubble Sort
MVI B, 05
START: LXI H,
2100
MVI C, 04
BACK: MOV A,
M
INX H
CMP M
JC END
STA 2200
MOV A, M
DCX H
MOV M, A
LDA 2200
INX H
MOV M, A
END: DCR
C
JNZ BACK
DCR B
JNZ START
HLT 





3) Exchanging the
Array Elements (Swap 2 Arrays)
LXI H, 2100
LXI D, 2200
MVI C, 0A
START: MOV A, M
STA 2300
LDAX D
MOV M, A
LDA 2300
STAX D
INX H
INX D
DCR C
JNZ START

4) Find the Highest
No in an Array
LXI H, 2100
MVI C, 03
MOV A, M
DCR C
INX H
START: CMP M
JNC NEXT
MOV A, M
NEXT: INX H
DCR C
JNZ START
STA 2200
HLT
8085 OPCODES
8085 OPCODES:
DATA TRANSFER:
40,
MOV B B, 4 50, MOV D B, 4 60, MOV H B, 4 70, MOV M B, 7 06,MVI B 8,7
41,
MOV B C, 4 51, MOV D C, 4 61, MOV H C, 4 71, MOV M C, 7 0E,MVI C 8,7
42,
MOV B D, 4 52, MOV D D, 4 62, MOV H D, 4 72, MOV M D, 7 16,MVI D 8,7
43, MOV B E, 4 53, MOV D E, 4 63, MOV H E, 4 73, MOV M E, 7 1E,MVI E 8,7
44, MOV B H, 4 54, MOV D H, 4 64, MOV H H, 4 74, MOV M H, 7 26,MVI H 8,7
45,
MOV B L, 4 55, MOV D L, 4 65, MOV H L, 4 75, MOV M L, 7 2E,MVI L 8,7
46,
MOV B M, 7 56, MOV D M, 7 66, MOV H M, 7 77, MOV M A, 7 36,MVI M 8,10
47,
MOV B A, 4 57, MOV D A, 4 67,
MOV H A, 4 78, MOV A B, 4 3E,MVI A 8,7
48,
MOV C B, 4 58, MOV E B, 4 68,
MOV L B, 4 79, MOV A C, 4
49,
MOV C C, 4 59, MOV E C, 4 69,
MOV L C, 4 7A, MOV A D, 4
4A,
MOV C D, 4 5A, MOV E D, 4 6A, MOV L D, 4 7B, MOV A E, 4
4B, MOV C E, 4 5B, MOV E E, 4 6B, MOV L E, 4 7C, MOV A H, 4
4C, MOV C H, 4 5C, MOV E H, 4 6C, MOV L H, 4 7D, MOV A L, 4
4D, MOV C L, 4 5D, MOV E L, 4 6D, MOV L L, 4 7E, MOV A M, 7
4E, MOV C M, 7 5E, MOV E M, 7 6E, MOV L M, 7 7F, MOV A A, 4
4F,
MOV C A, 4 5F, MOV E A, 4 6F, MOV L A, 4
LOAD:
0A,LDAX
B,7 01,LXI B 16,10 D3,OUT 8,10 E1,POP H,10
1A,LDAX
D,7 11,LXI D 16,10 DB,IN 8,10 F1,POP PSW,10
2A,LHLD
16,16 21,LXI H 16,10 C5,PUSH B,12
3A,LDA
16,13 31,LXI SP 16,10 D5,PUSH D,12
02,STAX
B,7 F9,SPHL,6 E5,PUSH H,12
12,STAX
D,7 E3,XTHL,16 F5,PUSH PSW,12
22,SHLD
16,16 EB,XCHG,4 C1,POP B,10
32,STA
16,13 EB,XCHG,4 D1,POP D,10
ARITHMATIC:
80,ADD B,4 85,ADD L,4 8A,ADC D,4 8F,ADC A,4 90,SUB B,4 96,SUB M,7
81,ADD C,4 86,ADD M,7 8B,ADC E,4 C6,ADI 8,7 91,SUB C,4 97,SUB A,4
82,ADD D,4 87,ADD A,4 8C,ADC
H,4 CE,ACI 8,7 92,SUB D,4 98,SBB B,4
83,ADD E,4 88,ADC B,4 8D,ADC
L,4 93,SUB
E,4 99,SBB C,4
84,ADD H,4 89,ADC C,4 8E,ADC M,7 94,SUB H,4 9A,SBB D,4
95,SUB L,4 9B,SBB E,4
9C,SBB H,4 09,DAD B,10 0C,INR C,4 3C,INR A,4 0D,DCR C,4 3D,DCR A,4
9D,SBB L,4 19,DAD D,10 14,INR D,4 03,INX B,6 15,DCR D,4 0B,DCX
B,6
9E,SBB M,7 29,DAD H,10 1C,INR E,4 13,INX D,6 1D,DCR E,4 1B,DCX
D,6
9F,SBB A,4 39,DAD SP,10 24,INR
H,4 23,INX H,6 25,DCR H,4 2B,DCX
H,6
D6,SUI
8,7 27,DAA,4 2C,INR
L,4 33,INX SP,6 2D,DCR L,4 3B,DCX SP,6
DE,SBI
8,7 04,INR B,4 34,INR
M,7 05,DCR B,4 35,DCR M,7
LOGICAL:
A0,ANA B,4 B0,ORA B,4 FE,CPI
8,4 CF,RST1,12 C8,RZ,6
A1,ANA C,4 B1,ORA C,4 07,RLC,4 D7,RST2,12 D0,RNC,6
A2,ANA D,4 B2,ORA D,4 0F,RRC,4 DF,RST3,12 D8,RC,6
A3,ANA E,4 B3,ORA E,4 17,RAL,4 E7,RST4,12 E0,RPO,6
A4,ANA H,4 B4,ORA H,4 1F,RAR,4 EF,RST5,12 E8,RPE,6
A5,ANA L,4 B5,ORA L,4 2F,CMA,4 F7,RST6,12 F0,RP,6
A6,ANA M,7 B5,ORA L,4 3F,CMC,4 FF,RST7,12 F8,RM,6
A7,ANA A,4 B6,ORA M,7 C3,JMP
AD,10 CD,CALL AD,18 00,NOP,4
E6,ANI 8,7 B7,ORA
A,4 C2,JNZ AD,7 C4,CNZ
AD,9 76,HLT,5
A8,XRA B,4 F6,ORI 8,7 CA,JZ
AD,7 CC,CZ AD,9 F3,DI,4
A9,XRA C,4 B8,CMP B,4 D2,JNC
AD,7 D4,CNC AD,9 FB,EI,4
AA,XRA D,4 B9,CMP C,4 DA,JC
AD,7 DC,CC AD,9 20,RIM,4
AB,XRA E,4 BA,CMP D,4 E2,JPO
AD,7 E4,CPO AD,9 30,SIM,4
AC,XRA H,4 BB,CMP E,4 EA,JPE
AD,7 EC,CPE AD,9
AD,XRA L,4 BC,CMP H,4 F2,JP AD,7 F4,CP
AD,9
AE,XRA M,7 BD,CMP L,4 FA,JM AD,7 FC,CM
AD,9
AF,XRA A,4 BE,CMP M,7 E9,PCHL,6 C9,RET,10
EE,XRI 8,7 BF,CMP A,4 C7,RST0,12 C0,RNZ,6
Microprocessor Programs
Microprocessor
Programs :
Multiplication of Two 4 bit Numbers
XRA
A
LXI
H, 2100
MOV
B,M
INX
H
L1: ADD M
DCR
B
JNZ L1
STA
2102
HLT
Multiplication of Two 8-bit Numbers
XRA A
MOV B,A
LXI H, 1100
MOV C,M
INX H
L2: ADD M
JNC L1
INR B
L1: DCR C
JNZ L2
INX H
MOV M,A
INX H
MOV A,B
MOV M,A
HLT
Addition Of Two Numbers:
LDA 4150
MOV B,A
LDA 4151
ADD M
STA 4152
HLT
Addition Of Two no(method 2)
LXI H,2050
MOV A,M
INX H
ADD M
INX H
MOV A,B
HLT
Subtraction of
Two no
LDA 4150
MOV B,A
LDA 4151
SUB B
STA 4152
HLT
Method 2 : Subtraction of Two No
LXI H,2050
MOV A,M
INX H
SUB M
INX H
MOV M,A
HLT
Biggest of Numbers
LXI H,4150
MOV C,M
INX H
MOV A,M
LOP: INX H
CMP M
JNC LOP1
MOV A,M
LOP1 DCR C
JNZ LOP
MOV M,A
HLT
Smallest of the No:
LXI H,4150
MOV C,M
MOV A,M
INX H
CMP M
JC LOOP1
MOV A,M
LOOP1:DCR C
JNZ LOOP
MOV M,A
HLT
Division
XRA
A
MOV
C,A
LXI
H,4150
MOV
B,M
INX
H
MOV
A,M
P1: SUB B
JC
L1
INC
C
JMP
P1
L1: ADD B
STA
4153
MOV
AMC
STA
4152
HLT
Block Transfer
LXI
H,2100
LXI
D,2200
MVI
C,0A
L1: MVI A,M
STAX
D
INX
H
INX
D
DCR
C
JNZ
L1
HLT
RST
7
Ascending Order
LXI H,4150
MOV C,M
L1: MOV B,C
INX H
MOV A,M
PUSH H
DCR B
JZ LA1
L2: INX H
CMP M
JC L3
MOV D,A
MOV A,M
MOV M,D
L3: DCR B
JNZ L2
POP H
MOV M,A
DCR C
JMP L1
LA1: HLT
Decending Order:
LXI
H,4150
MOV
C,M
L1: MOV B,C
INX
H
MOV
A,M
PUSH
H
DCR
B
JZ
LA1
L2: INX H
CMP
M
JNC
L3
MOV
D,A
MOV
A,M
MOV
M,D
L3: DCR B
JNZ
L2
POP
H
MOV
M,A
DCR
C
JMP
L1
HLT
Binary To BCD
LXI H,2101
MVI C,04
AGAIN: ORA M
DCR C
JZ FINISH
RLC
FINISH: INX H
JMP AGAIN
INX H
CPI OA
JC RESULT
MVI A,EE
RESULT: MOV M,A
MOV M,C
HLT
BCD To Binary
MVI D,08
LXI H,2100
MVI C,04
MOV B,M
AGAIN: MOV A,B
INX H
ANA D
JZ LOOP
MVI A,01
MOV A,D
RRC
MOV D,A
DCR C
JNZ AGAIN
HLT
Decimal to Hexa
XRA A
MOV C,A
LXI H,2100
MOV B,M
L1: ADI 64
JNC L2
INR C
DCR B
L2: JNZ L1
MOV D,A
INX H
MOV B,M
XRA A
ADI 0A
L3: DCR B
JNZ L3
INX H
ADD M
ADD D
JNC L4
INR C
L4: INX H
MOV M,C
INX H
MOV M,A
HLT
Hexa Decimal to Decimal
LXI
H,4150
LXI
B,0000
MOV
A,M
SUI
64
JC L2
INR
B
JMP
L1
ADI
64
SUI
OA
JC
L4
INR
C
MOV
M,B
MOV
B,A
MOV
A,C
RLC
RLC
RLC
RLC
ADD
B
INX
H
MOV
M,A
HLT
Subscribe to:
Posts (Atom)
WASE open book exams - June 2013
Hey waseians, All the best for exams... ☺ Exams time table Useful posts for open book exam Semester 3 materials Get ready...

-
Hey waseians, All the best for exams... ☺ Exams time table Useful posts for open book exam Semester 3 materials Get ready...
-
CDC :- Chennai Development Center BDC :- Bangalore Development Center GNDC :- Greater Noida Development Center HDC :- Hyderabad Dev...