You are on page 1of 58

A

ON
ASSEMBLY COMPILER USING “C”

[For the fulfillment of three-year BCA course]

Submitted To: Submitted By:

The Director Your Name


(Sr&E Division) Enroll No:**********
Block3,Maidan Garhi Cource Code:
IGNOU StudyCenterCode:
NEW DELHI

www.solutioncab.com (This is a sample project For BCA Students)


ACKNOWLDEGEMENT

At the onset, I wish to convey my sincere thanks and gratitude to Mr.*******, who

helped in innumerable ways and without his constant help and inspiration the idea of

completing this project could not have probably worked out.

I am so much grateful to Mr. ******** who helped and keeps out moral high, which

enabled to complete the assigned project. My heartiest thanks to all those who

directly or indirectly helped me by contributing their valuable suggestions and

constructive criticism, which has helped me in completing this project.

Your Name

www.solutioncab.com (This is a sample project For BCA Students)


CERTIFICATE OF ORIGINALITY

This is to certify that the project report entitled “ASSEMBALY COMPILER


USING C” Submitted to Indira Gandhi National Open University in partial
fulfillment of the requirement for the award of the degree “ BACHELOR IN
COMPUTER APPLICATION (BCA)” is an original work carried out by
Mr. Your Name.

The matter embodied in this project is a genuine work done by the student and has
not been submitted whether to this University or to any other University/ Institute
for the fulfillment of the requirement of any course of study.

Date:

Signature of the Student Signature of the Guide

Name and Address Name, Designation and


Of the student: Address of the Guide

www.solutioncab.com (This is a sample project For BCA Students)


RESUME OF GUIDE

Attach Resume of your Guide here

www.solutioncab.com (This is a sample project For BCA Students)


TABLE OF CONTENTS

1. INTRODUCTION
2. OBJECTIVE
3. TOOLS & ENVIRONMENT USED
4. COST ESTIMATION
5. ANALYSIS &DESIGN
6. PROGRAM STRUCTURE
7. SECURITY
8. CODING
9. TESTING
10. OUTPUT
11. LIMITATION OF PROJECT
12. FUTURE APPLICATION OF PROJECT
13. BIBLIOGRAPHY

www.solutioncab.com (This is a sample project For BCA Students)


1. INTRODUCTION

There are various applications which provide facility to run a program developed in one

programming language and run on the compiler of different language e.g. COBRA.

Like cobra it is also the latest & exiting to work on.

Inspired from cobra the project “Assembly compiler using C” is software that enables the user

to run a program developed in assembly language on a c compiler and get the required out put.

An assembly language is a low level language .the greatest disadvantage of assembly language

is the machine dependency i.e. a program developed on one machine cannot run on another

machine there fore their always need for a software through which a user can a assembly

language program on every machine .

Since it is not possible with out a assembler.

The “Assembly compiler using C “is a software developed in ‘c’ language that takes a

assembly language program as input and display the out put of the program . Hence we can

run an assembly language program on c compiler with out nee of any assembler

Why use ‘c’?

Ans :To develop any software project, Selection of a suitable language is very important. In

selection of the language we adopt few criteria keeping in view the “Aim of Project”. It should

be considered those features which the project needs while designing, whether the chosen

language incorporates such facilities to implement the features or certain criteria like:

1. The programming should offer Simple data structure & control structure

suitable for Algorithm It should be easy to code conveniently to debugs

www.solutioncab.com (This is a sample project For BCA Students)


2. It should not be difficult to understand what the program is doing, So that the

program can be maintained and modified at a later stage.

3. The program should be portable i.e. it should be run on other computers & Its

implementation should be fairly standard

4. The program should be efficient and full of compactness.

Together with these feature ‘C’ also provide some more facility which make

the development of this software easy.

www.solutioncab.com (This is a sample project For BCA Students)


2.OBJECTIVE

The main objective of this project is to compile or get output of the assembly language

programs by using the “C” compiler. So that the it becomes easier to work with assembly

language

www.solutioncab.com (This is a sample project For BCA Students)


3. Tools & environment used

Hardware requirements

On hardware side this programs does not need some thing extra i.e it will run on minimum

configuration

Like

IBM/PC/ XT/AT

RAM 80Kb

Few Mb storage space

Dos operating environment

Soft ware requirement

The two necessary requirements are

C++ compiler

Editor

www.solutioncab.com (This is a sample project For BCA Students)


4.COST ESTIMATION

While cost is a factor in some cases the driving force behind the development of any s/w but cost
alone cannot determine our plan. Our plan must include requirement, functionality, construction,
implementation and maintenance.
To guess the cost without the idea of the overall design will surely start our project on the
road to failure.
Design an project or s/w will cost in different ways like testing cost analysis cost, design
cost, etc. the cost analysis will the highest.
The total cost estimation for “Assembly compiler using ‘C’” is Rs 5500.

S.NO %of cost cost


1 Analysis 10% 550
2 Design 20% 1100
3 Coding 10% 550
4 Testing 50% 2750
5 maintance 10% 550

5. ANALYSIS AND DESIGIN


www.solutioncab.com (This is a sample project For BCA Students)
4.1 Problem Statement:

The main problem with assembly language programs is that they can run on the assembly language

compilers to over come this disadvantage’ this project is design i.e. the main function of “assembly

compiler using “C” ” is that it take assembly language program as source and run the code on’ c’

compiler and give the required out put of the program in a separate file

4.2 Functions to be provided:

In this project

• First the program code or the assembly language programs is stored in a particular file

named code.1

• The data stored in the file code.1 is the source code for the c compiler that runs the

program

• The result of the program is stored in a separate file.

4.3 Solution Strategy:

An assembly language consists 0f mnemonic and operands .the mnemonic may contain 0,1 or 2

operands. There are limited no of mnemonics in assembly language. Generally registers are used

as operand. To run the program on a ’C’ compiler first of all the program is converted into such a

form which can be understandable by a ’C’ compiler

Following is the strategy to convert a assembly language program into a ‘C’ compiler understand

able form

Extract statement are one by one followed by the assembly language program

• Firstly separate the label, mnemonic &operand part of the statements.

• Check if the statement contains label .if yes perform the appropriate operations

corresponding to the label in ‘C’ language

www.solutioncab.com (This is a sample project For BCA Students)


• Check if the statement contains mnemonic .if yes perform the appropriate operations

corresponding to the mnemonic in ‘C’ language

• Read the operands and create variables and constants corresponding to the operand in ‘C’

language.

• Convert all statements into ‘C’ understandable form and store it into a file.

Now run this code and produce the result of the program

Two data base files are required for this conversion. The first data file contains list of the entire

mnemonic along with possible operand they can have. It also contains hexadecimal code

equivalent to each operand and no of bytes required to store each operand.

The second file contains list of mnemonic along with possible list of operands It can take the

hexadecimal code corresponding to each operand.

By the use of these two data files the ‘C’ compiler generates a hexadecimal file corresponding to

the assembly program which is also understandable by ‘C’ compiler

The hexadecimal file acts as an intermediate file between assembly and ‘C’ compiler

4.3.1. Design:

Software design focuses on four distinct attributes of a program - data structure,

software architecture, interface representations, and procedural (algorithmic) detail.

The design process translates requirements into a representation of the software that

can be accessed for quantity before code generation begins.

4.3.2. Code Generation:

This step translates the design into a machine-readable form. If design is performed in

a detailed manner, code Generation can be accomplished mechanistically. Various

‘ C’ Files are to be developed during this phase to implement the logic.

4.3.3 Testing:

www.solutioncab.com (This is a sample project For BCA Students)


Testing begins after the code has been generated. This process focuses on the logical

intervals of the software, assuring that all statements have been tested, and on the

functional externals-that is conducting tests to uncover errors and ensure that defined

input will produce actual results that agree with required results..

4.3.4 Maintenance:

Software will undoubtedly undergo change after it is delivered to the customer.

Change occurs because of the errors encountered, because software must be adapted

To accommodate changes in its external environment- or because the customer

Requires the functional or performance enhancements. Software maintenance reapplies

each of the preceding phases to an exiting program rather than new one.

The Flow chart’s and the DFD’s for the design are included in the coming

Sections.

HOW PROGRAMS WORKS

DATA FLOW DIAGRAMDIAGRAM OF THE LOGIC

www.solutioncab.com (This is a sample project For BCA Students)


DFD- 0- LEVEL

INPUT ASSEMBLY PROCESS PROGRAM


ON ‘C’ COMPILER
RESULT OF
LANGUAGE PROGRAM
PROGRAM

FIG : 1

DFD -1- LEVEL

CODE 1.DAT CODE 2.DAT


CODE.DAT CODE2.DAT FUNCTION.C RESULT.DAT

ASM.C
ASM.C TEST.C

C++
COMPILE
R
CALCULATE
TEST.HEX
HEX CODE
TEST.ASM

STEP.DAT

GENERATE STATUS OF
EACH REGISTER
THROUGH HEX FILE
&STORE IT IN RESULT
FILE
FIG: 2

TEST.ASM

C++COMPILER

DFD -2-LEVEL

GENERATE
HEXTABLE & STORE
IT IN RESULT . HEX
www.solutioncab.com (This is a sample project For BCA Students)

RESULT.DAT
FIG :3

FLOW CHART OF MAIN PROGRAM

www.solutioncab.com (This is a sample project For BCA Students)


READ NEXT
INSTRUCTION

CREATE SYMBOL TABLE


IS
SYMB
OL SYMBOL COPY ( )

READ MNEMONIC &


OPERAND

IF
MNEMO LABEL COPY
NIC IS
CALL LABELCOPY( )

IS EOF END OF PASS 2


PASS 1

RESET FILE POINTER

RESET NEXT
INSTRUCTION

INTERPRET MNEMONIC IS EOF


&OPERAND&GENERATE
C&HEXFILE

CFILE( ), SEARCHHEX( ) STOP

FIG: 4

www.solutioncab.com (This is a sample project For BCA Students)


C FILE GENERATION

READ MNEMONIC & OPERAND

FIND CCODE, FORMAT,LENGTH

SEARCH CODE( )

GENERATE C FILE

CFILE( )

IS EOF( )

STOP

FIG:5

www.solutioncab.com (This is a sample project For BCA Students)


SYMBOL TABLE GENERATION

READING PROGRAM
COUNTER

TEMPERORY STORE THIS


VALUE IN ANOTHER VAR.

READ FIRST MNEMONIC

A
IS EOF STO
P

CHECK
SEARCH THE MNEMONIC FOR
FOR A SYMBOL SEMICOLO
N

COPY THE SYMBOL

www.solutioncab.com (This is a sample project For BCA Students)


B

IS
SEMICO SKIP WHOLE LINE
LON = 2

IS
SEMICOLON= READ NEXT
2 INSTRUCTION

SKIP WHOLE LINE


A
LENGTH OF MNEMONIC

UP DATE PROGRAM
COUNTER

FORMAT
IS !
=NONE

IS IS
READ OPERAND SEMICOL CCODE==’
ON==2 C’

SKIP WHOLE LINE COPY THE LABEL

www.solutioncab.com (This is a sample project For BCA Students)


6. PROGRAM STRUCTURE

The different functions are used in this project are:

Functions Defined in ASM.C


Cfile ( ) : Generates equivalent c code for each mnemonic writ ten in the source *.asm

file(c file generation).

address ( ) :Print 2nd and/or 3rd byte in *.hex file if the length of the instruction is not one

byte (hex file generation).

Search Label ( ) : Returns 1if the label is a call instruction operand (Subroutine Handling).

Separate ( ) : if the operand format contains a comma then the operand is divided in two

separate parts (Source file Manipulation).

Semicolon ( ) : Check if there is any semicolon in source file (Comments Handling)

SearchCode( ) : Search into code.dat for length, format and c code (cfile generation).

Overwrite ( ) : Avoid any overwritten *.c file if it is already exist (security option)

LabelCheck( ) : check for label in label field(Symbol Table generation).

LabelCopy ( ) : Copy the operand of call instruction Label Table(Subroutine handling)

dec2hex( ) : Converts a decimal into hex(Program counter printing into hex file) -

SearchHex( ) : Searching the hex code of instruction into code2.dat (hex file generation).

SymbolCopy( ) : Copy the label of label field into Symbol table(Symbol table generation).

Main ( ) : The Function From, Which Execution Starts. main( ) Calls some of functions

described above. Generates *.c and *.hex file with the help of *.asm. code.dat &

code2.dat.

www.solutioncab.com (This is a sample project For BCA Students)


Functions defined in FUNCTION.C

dec2hex( ) : Convert decimal number into hexadecimal(Printing into result.dat & step.dat).

stepresult( ) : Prints status of registers and flags into step.dat (Intermediate result file

generation)

result( ) : Prints status of resisters, flags and memory locations into result.dat (Final

result file generation).

Auxiliary( ) : Set the state of auxiliary flag depending on the operation (Processing of

mnemonic)

legal( ): Set the state of sign, zero and parity flag depending on the register contents

(Processing of mnemonic)

store( ) : Adds a new node into memory list, which contains location and its

content&(Memory Handling).

load( ) : Loads the contents of given memory location from the memory list (Memory Handling)

compare( ) : Handling of CMP & CPI instruction

value( ) : Prompting for the contents of memory location which is refrenced but not

found into memory list (Memory Handling).

Check( ) : Returns 1 if the location is not into the Memory list (Memory Handling).

scanmem( ) : Gettinh the contents of Memory location (Memory Handling).

Push( ) : PUSH instruction handling.

pop( ) : POP instruction handling.

7. CODING
www.solutioncab.com (This is a sample project For BCA Students)
#include<iostream.h>
#include<dos.h>
#include<alloc.h>
#include<graphics.h>
#include<conio.h>/#include<iostream.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include<math.h>
#define CLIP_ON 1 /* activates clipping in viewport */
#include "shape.h"
#include "triangle.h"
#include "rect.h"
#include"polygon.h"
#include "circle.h"
#include "ellipse.h"
#include "text.h"
#include "brsh.h"
#include "plane.h"
class shape *s1;
Gstring gs;
triangle t1;
rect r1;
pol p1;
circ c;
int col = 1;
unsigned int initmouse();
void getmousepos(int *button, int *x, int *y);
void getmouseposll(int *button,int *x, int *y);
void restrictmouseptr(int x1, int y1, int x2, int y2);
void showmouseptr ();
void view_menu6();
void select_shapes ();
void select_settings ();
void select_operations ();
void select_text ();
void select_file ();
void select_view();
void shapes ();
void display();
void set();
void disp_set();
void opr();
void disp_opr();
void txt ();
void disp_txt ();

www.solutioncab.com (This is a sample project For BCA Students)


void disp_fil();
union REGS i,o;
int x,y,button;
int shape = 0;
int oparation = 0;
int setting = 0;
int opt =0;
main()
{
int gd=DETECT,gm,maxx,maxy;
initgraph(&gd,&gm,"c:\\tc\\bgi");
Gstring s;
s.setText(" OBJECT ORIENTED GKS FOR FIGURES AND STRINGS");
s.setfont (TRIPLEX_FONT);
s.setHorzsize(3,4);
s.setvertsize(4 ,1);
setbkcolor(2);
setcolor(1);
s.DrawText ();
getch();
detectgraph(&gd, &gm);
initgraph(&gd,&gm,"c:\\tc\\bgi");
int i,w;
setcolor(GREEN);
outtextxy(20,100, "ADDRESS:");
outtextxy(20,101," ________");
//outtextxy(20,120, " DR.M.V.SESHAGIRI RAO");
outtextxy(20,135,"ASSOSIATE PROFESSOR");
outtextxy(20,150, " DEPT. OF CIVIL ENGINEERING");
outtextxy(20,165, " J.N.T.U COLLEGE OF ENGINEERING");
outtextxy(20,180, " KUKATPALLY , HYDERABAD-500072");
setcolor (YELLOW);
outtextxy(10, 300, " THE SOFTWARE DISPLAYS FIGURES DIFFERENT FONTS.");
outtextxy(10,315,"U* LANGUAGE USED FOR THIS SOFTWARE 3 SUPPORTS OOPS
");
setviewport (290, 440, 600, 460, 1) ;
setfilistyle (SOLID_FILL, GREEN);
bar ( 0, 0, 310, 20);
setcolor(RED);
outtextxy(2,5," PRESS ANY KEY TO CONTINUE");
setcolor(15);
setviewport(300, 100, 500,200,1);
setbkcolor(RED);
setfillstyle(SOLID_FILL,BLUE);
bar( 0, 0, 200, 100);
for(i=100; 1+200>0; i-=5)
{
delay(100);

www.solutioncab.com (This is a sample project For BCA Students)


setfilistyle (SOLID_FILL, BLUE);
bar(0,0,200, 100);
setfilistyle (SOLID_FILL, YELLOW);
fillellipse(88, 3,12,9);
plane(i, 10);
plane (i+15, 30);
plane (i+50, 13) ;
plane(i+70,70);
outtextxy(i,50);
}
getch ();

maxx=getmaxx ();
maxy=getmaxy();
rectangle (0,0,maxx,maxy);
setviewport(1,1,maxx-1,maxy-1,1);
gotoxy(26, 1);
printf(" OBJECT ORIENTED GKS PROGRAMME");
if(initmouse()==0)
{
closegraph ();
restorecrtmode();
printf("\n MOUSE DRIVE NOT LOADED:");
exit(1);
}
restrictmouseptr(1 1,maxx-1,maxy-1);
showmouseptr();
setcolor (RED); outtextxy(35,50, "SHAPES");
setcolor(BROWN); outtextxy(135, 50, "SETTINGS");
setcolor (GREEN); outtextxy(235,50, "OPARATIONS");
setcolor (YELLOW); outtextxy(335, 50, "TEXT");
setcolor (MAGENTA); outtextxy(425,50, "FILE");
setcolor(RED); outtextxy(490,50, "BRUSH");
setcolor (BLUE); outtextxy(550,50, "VIEW");
gotoxy(25,3); printf("PRESS ANY KEY TO EXIT:");
while ( ! kbhit ())
{
getmousepos(&button, &x, &y);
if( (x>30&&x<110) && (y>50&&y<55))
{
if( (button &1) ==1)
{
opt= 1;
setcolor(1);
select_shapes ();
}
}
if( (x>125&&x<210) && (y>50&&y<55))

www.solutioncab.com (This is a sample project For BCA Students)


{
if( (button &1) ==1)
{
setcolor(2);
select_settings ();
}
if( (x>225&&x<310) && (y>50&&y<55))
{
if ( (button &1)==1)
{
setcolor(3);
select_operations ();
}
}
if( (x>340&&x<400) && (y>50&&y<55))
{
if( (button &1) ==1)
{
opt = 2;
setcolor (4);
select_text ();
}
}
if( (x>440&&x<480) && (y>50&&y<55))
{
if( (button &1) ==1)
{
setcolor(5);
select_file ();
}
}
if( (x>490&&x<540) && (y>50&&y<55))
{
if( (button &1) ==1)
{
setcolor(5);
outtextxy(15,185,"brush menu is selected ");
select_brush ();
}
}
if( (x>550&&x<600) && (y>50&&y<55))
{
if( (button &1)==1)
{
setcolor(6);
view_menu6 ();
}
}

www.solutioncab.com (This is a sample project For BCA Students)


setviewport (1,1,maxx-1,maxy-1,1);
gotoxy(50,2);
cout<<"X = "<<x; cout<<"\tY = "<<y;
}/* END OF WHILE*/
return 0;
}/* END OF MaiN */

void view_menu6()
{
setviewport(1,100,getmaxx()-1,getmaxy()-1,CLIP_ON);
if (opt == 1)
{
switch (shape)
{
case 1: s1=&r1;break;
case 2: s1= = &t1;break;
case 3: s1 = &p1;break;
case 4: s1 = &c;break;
case 5: s1 = &e;
}
switch (oparation)
{
case 1: s1->reset();break;
case 2: s1->scaling();break;
case 3: s1->translate();break;
case 4: s1->rotate();
}
s1->draw();
if (oparation)
{
s1->reset();
s1->draw();
}
}
// endof if
if (opt == 2)
{
gs.DrawText ();
gs.reset();
}
opt=0;
getch();
clearviewport ();
}
unsigned int initmouse()
i.x.ax=0;
int86(0x33,&i,&o);
return (o.x.ax) ;

www.solutioncab.com (This is a sample project For BCA Students)


}

void showmouseptr()
{
i.x.ax=1;
int86(0x33,&i,&o);
}
void restrictmouseptr(int x1,int y1,int x2,int y2)
{
i.x.ax=7;
i.x.cx=x1;
i.x.dx=x2;
int86(0x33,&i,&o);
i.x.ax=8;
i.x.cx=y1;
i.x.dx=y2;
int86(0x33,&i,&o);
}
void getmousepos(int *button,int *x,int *y)
{
i.x.ax=3;
int86 (0x33, &i, &o);
*button = o.x.bx;
*x=o.x.cx;
*y=o.x.dx;
}
void getmousepos11(int *button,int *x,int *y)
{
i.x.ax=3;
int86(0x33, &i, &o);
*button=o.x.bx;
*x= o.x.cx;
*y= o.x.dx;
}
void display()
{
setviewport(30, 60, 125, 190, CLIP_ON);
rectangle(0, 0,95,120);
outtextxy(5,5,"Rectangle");
outtextxy(5,25,"Triangle");
outtextxy(5,45,"Polygon");
outtextxy(5,65,"Circle");
outtextxy(5,85, "Ellipse");
outtextxy(5,100, "Exit");
}
void select_shapes()
{

www.solutioncab.com (This is a sample project For BCA Students)


while(1)
{
getmousepos11(&button, &x, &y);
if((button &1)==1)
{
if((x>36&&x<86) && (y>65&&<85))
{
shape= 1;//s = &r1;
col = (++col%15);
setcolor(col+l);
outtextxy(5,5,"Rectangle");
}
if( (x>36&&x<86) && (y>86&&y<95))
{
shape = 2;//sl = &tl;
col = (++col%15);
setcolor(col+1);
outtextxy(5,,25,"Triangle");
}
if( (x>36&&x<86) && (y>100&&y<110))
{
shape= 3;//s1= &p1
col(++col%15);
setcolor(col+1);
outtextxy(5,45,"Polygon");
}
if((x>36&&x<86) && (y>120&&y<130))
{
shape=4;//s1 =&c;
col = (++col%15);
setcolor (col+l);
outtextxy(5,65, "Circle");
}
if( (x>36&&x<86) && (y>140&&y<150))
{
col = (++col%15);
setcolor(col+1);
textbackground(col+2);
outtextxy(5, 85,"Ellipse");
}
if( (x>36&&x<86) && (y>160&&y<170))
{
col (++col % 15);
setcolor(col+1);
textbackground (col+2);
outtextxy(5, 100,"Exit"); clearviewport();
break;
}

www.solutioncab.com (This is a sample project For BCA Students)


display();
}//end of If
}// end of while
}//end of shapes()
void disp_set()
{
setviewport(130,60,225,175,CLIP_ON);
rectangle (0, 0, 95, 110) ;
outtextxy(5,5, "Line Color");
outtextxy(5,25, "Line Style");
outtextxy(5,45, "Fill Color");
outtextxy(5,65, "Fill Style");
outtextxy(5,85, "Exit");
}
void select_settings ()
{
int color,style;
while(1)
{
getmousepos11 (&button, &x, &y);
if( (button &1)==1)
{
if( (x>136&&x<186) && (y>65&&y<85))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,5, "Line Color");
printf ( "\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter value of line color : 0 - 15 ");
scanf("%d",&color);
gotoxy(5,17); printf(" ");
gotoxy(1,1);
s1->set_line_style (color);
s1->settings ();
setviewport (1, 1, getmaxx()-1, getmaxy() -1, CLIP_ON);
}
if( (x>136&&x<186) && (y>86&&y<95))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,25, "Line Style");
printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter value of line style: 0 - 4 ");
scanf("%d", &style);
gotoxy(5,17);
printf("");
gotoxy(1,1);
s1->set_line_style (color, style);

www.solutioncab.com (This is a sample project For BCA Students)


s1->settings ();
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>136&&x<186) && (y>100&&y<llO))
{
col = (++col%15);
setcolor(col+1);
outtextxy(5,45, "Fill Color");
printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter value of fill color: 0-15 ");
scant("%d", &color);
gotoxy(5,17);
printf(" ");
gotoxy(1,1);
s1->set_fill_style (color);
s1->settinqs ();
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>136&&x<186) && (y>120&&y<130))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,65,"Fill Style");
printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter value of fill style : 0-15 ");
scanf("%d",&style);
gotoxy(5, 17);
printf(" ");
gotoxy(1,1);
s1->set_fill_style(color, style);
s1->settings();
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>136&&x<186)&&(y>140&&y<150))
{
col = (++col%15);
setcolor(col+1);
outtextxy(5,85,"Exit");
clearviewport();
break;
}
disp_set ();
}// end of if
}// end of while
}//end of set()

void disp_opr()

www.solutioncab.com (This is a sample project For BCA Students)


{
setviewport(230, 60, 325, 175, CLIP_ON);
rectangle(0,0, 95,110);
outtextxy(5,5,"Normal");
outtextxy(5,25,"Scaling");
outtextxy(5,45,"Translation");
outtextxy(5,65,"Rotation");
outtextxy(5,85,"Exit");
}

void select_operations()
{
while(1)
{
getmousepos11(&button, &x, &y);
if( (button= &1)==1)
{
if( (x>236&&x<286) && (y>65&&y<85))
{
oparation-1;//s->reset();
col = (++col % 15);
setcolor(col+1);
outtextxy(5,5,"Normal");
}
if((x>236&&x<286) && (y>86&&y<95))
{
operation=2;//s->scalling();
col =(++col % 15);
setcolor(col+1);
outtextxy(5,25,"Scaling");
}
if((x>236&&x<286) && (y>100&&y<110))
{
oparation = 3;//sl->translate();
col = (++col%15);
setcolor(col+1);
outtextxy(5,45,"Translation");
}
if((x>236&&x<286) && (y>120&&y<130))
{
oparation = 4;//sl->rotate();
col (++col % 15);
setcolor(col+1);
outtextxy(5, 65,"Rotation");
}
if((x>236&&x<286) && (y>140&&y<150))
{

www.solutioncab.com (This is a sample project For BCA Students)


outtextxy(5,85 "Exit");
clearviewport ();
break;
}
disp_opr();
}// end of if
}//end of while
}//end of set()

void disp_txt()
{
setviewport(330, 60, 425, 175, CLIP_ON);
rectangle(0,0,95,110);
outtextxy(5,5,"Text");
outtextxy(5,25,"Font");
outtextxy(5,45, "Size");
outtextxy(5, 65,"Orientation");
outtextxy(5,85, "Exit");
settextstyle (DEFAULT_FONT,HORIZ_DIR, 1);
settextjustify(LEFT_TEXT,TOP_TEXT);
setusercharsize(1, 1,1,1);
}

void select_text()
{
char string[20];
int font = 0;
int size = 1;
int dir = 0;
while(1)
{
getmousepos11(&button, &x, &y);
if( (button &1) ==1)
{
if( (x>336&&x<386) && (y>65&&y<85))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,5,"Text");
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter the text ");
scanf("%s",string);
gotoxy(5, 17);
printf(" ");
gotoxy(1,1);
gs.setText (string);

www.solutioncab.com (This is a sample project For BCA Students)


gs.setposition(300,200);
setcolor(3);
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>336&&x<386) && (y>86&&y<95))
{
col= (++col % 15>;
setcolor(col+1);
outtextxy(5,25,"Font");
printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter the value of font (0 - 4)");
scanf("%d", &font);
gotoxy(5,16);
printf(" ");
gotoxy(1, 1);
gs.setfont(font);
setviewport(1, 1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>336&&x<386) && (y>100&&110))
{
col (++col % 15);
setcolor(col+1);
outtextxy(5,45,"Size");
printf ("\n\n\n\n\n\n\n\n\n\ri\n\n\n\n\n");
printf("\tenter the value of size (0-4)");
scanf("%d", &size);
gotoxy(5,16);
priritf(" ");
clearviewport ();
gotoxy(1,1);
gs.setsize(size);
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}
if( (x>336&&x<386) && (y>120&&y<130))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,65,"Orientation");
printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\tenter the direction (0/1)");
scanf("%d", &dir);
gotoxy(5,16);
printf(" ");
clearviewport();
gotoxy(1,1);
gs.setdirection (dir);
setviewport(1,1,getmaxx()-1,getmaxy()-1,CLIP_ON);
}

www.solutioncab.com (This is a sample project For BCA Students)


if( (x>336&&x<386) && (y>140&&y<150))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,85,"Exit");
clearviewport();
break;
}
disp_txt ();
}// end of if
}// end of while
}//end of set()

void disp_fil()
{
setviewport(430, 60, 525, 175, CLIP_ON);
rectangle (0, 0, 95, 110) ;
outtextxy(5,5,"Save");
outtextxy(5,25,"Open");
outtextxy(5,45,"Close");
outtextxy(5,65,"Exit");
}

void select_file ()
{
while (1)
{
getmousepos11(&button, &x, &y);
if( (button &1) ==1)
{
if( (x>436&&x<486) && (y>65&&y<85))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,5,"Save");
}
if( (x>436&&x<486) && (y>86&&y<95))
{
col = (++col%15);
setcolor(col+1);
outtextxy(5,25, "Open");
}
if( (x>436&&x<486) && (y>100&&110))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,45,"Close");

www.solutioncab.com (This is a sample project For BCA Students)


}
if( (x>436&&x<486) && (y>120&&y<130))
{
col = (++col % 15);
setcolor(col+1);
outtextxy(5,65,"Exit");
clearviewport();
break;
}
disp_fil();
}//end of if
}// end of while
}//end of fil()

FUNCTION.C

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
struct mem
{
unsigned int location;
unsigned int contents;
struct mem *link;
};
struct mem *memory;
struct regp
{
unsigned int psw,b,d,h,sp;
};
struct reg
{
unsigned char f,a,c,b,e,d,i,h;
};
union REG
{
struct regp x;
struct reg h;
};
union REG r;
FILE *fpstep;
unsigned int pc=0;
unsigned char temp=0;
unsigned int temp1=0;
char str[5],str1[5],ch;
int i=0;
void dec2hex(unsigned char dec,char *str)

www.solutioncab.com (This is a sample project For BCA Students)


{
sprintf(str,"%x",dec);
strrev(str);
if(strlen(str)==0) strcat(str,"00");
if(strlen(str)==1) strcat(str,"0");
strrev(str);
strupr(str);
}
void stepresult()
{
dec2hex(r.h.a,str);
fprintf(fpstep,"%-4s",str);
dec2hex(r.h.b,str);
fprintf(fpstep," %-4s",str);
dec2hex(r.h.c,str);
fprintf(fpstep,"%-4s",str);
dec2hex(r.h.d,str);
fprintf(fpstep,"%-4s",str);
dec2hex(r.h.e,str);
fprintf(fpstep,"%-4s",str);
dec2hex(r.h.h,str);
fprintf(fpstep,"%-4s",str);
dec2hex(r.h.i,str);
fprintf(fpstep,"%-4s",str);
fprintf(fpstep,"%-4d",(r.h.f & 0x80)!=0);
fprintf(fpstep,"%-4d",(r.h.f & 0x40)!=0);
fprintf(fpstep,"%-4d",(r.h.f & 0x10)!=0);
fprintf(fpstep,"%-4d",(r.h.f & 0x04)!=0);
fprintf(fpstep,"%-4d",r.h.f & 0x01);
}
void result()
{
FILE *fp;
struct mem *temp;
fp=fopen("result.dat","w");
fprintf(fp,"\nSTATUS OF REGISTERS:\n");
dec2hex(r.h.a,str);
fprintf(fp,"A=%-10s",str);
dec2hex(r.h.b,str);
fprintf(fp,"B=%-10s",str);
dec2hex(r.h.c,str);
fprintf(fp,"C=%-10s",str);
dec2hex(r.h.d,str);
fprintf(fp,"D=%-10s",str);
dec2hex(r.h.e,str);
fprintf(fp,"E=%-10s",str);
dec2hex(r.h.h,str);
fprintf(fp,"H=%-10s",str);

www.solutioncab.com (This is a sample project For BCA Students)


dec2hex(r.h.i,str);
fprintf(fp,"L=%-10s",str);
fprintf(fp,"\n\nSTATUS OF FLAGS:\n");
fprintf(fp,"S=%-12d",(r.h.f & 0x80)!=0);
fprintf(fp,"Z=%-12d",(r.h.f & 0x40)!=0);
fprintf(fp,"AC=%-10d",(r.h.f & 0x10)!=0);
fprintf(fp,"P=%-10d",(r.h.f & 0x04)!=0);
fprintf(fp,"CY=%-10d",r.h.f & 0x01);
fprintf(fp,"\n\nSTATUS OF MEMORY LOCATIONS:");
temp=memory;
{
sprintf(str,"%x",temp->location);
strrev(str);
while(strlen(str)!=4)
strcat(str,"0");
strrev(str);
strupr(str);
sprintf(str1,"%x",temp->contents);
strrev(str1);
if(strlen(str1)==0) strcat(str1,"00");
else if(strlen(str1)==1) strcat(str1,"0");
strrev(str1);
strupr(str1);
fprintf(fp,"\nLocation:%sContents:%s",strupr(str),strupr(str1));
temp=temp->link;
}
fclose(fp);
}
void auxilary(unsigned char a,unsigned char b)
{
a &=0x0f;
b &=0x0f;
if(a+b>0xf)
r.h.f|=0x10;
else
r.h.f&=0xef;
}
void legal(unsigned char num)
{
unsigned char p=0;
if(num==0)
{
r.h.f&=0x7b;
r.h.f|=0x40;
return;
}
if((num & 0x80)==0x80) r.h.f|=0x80;
else r.h.f&=0x7f;

www.solutioncab.com (This is a sample project For BCA Students)


if((num & 0x40)==0x40) r.h.f|=0x40;
else r.h.f&=0xbf;
while(num>0)
{
if(num>(num<<1)) p++;
num<<=1;
}
if(p%2==0) r.h.f|=0x04;
else r.h.f&=0xfb;
}
void store(unsigned int loc,unsigned int con)
{
struct mem *temp,*ptemp,*ptr;
ptr=(struct mem *)malloc(sizeof(struct mem));
ptr->location=loc;
ptr->contents=con;
ptr->link=NULL;
temp=memory;
if(temp==NULL)
{
memory=ptr;
return;
}
while(temp)
{
if(temp->location==loc)
{
temp->contents=con;
return;
}
temp=temp->link;
}
temp=memory;
if(temp->location>loc)
{
ptr->link=memory;
memory=ptr;
}
else
{
while(temp->location<loc && temp!=NULL)
{
ptemp=temp;
temp=temp->link;
}
ptr->link=temp;
ptemp->link=ptr;
}

www.solutioncab.com (This is a sample project For BCA Students)


}
unsigned int load(unsigned int loc)
{
struct mem *temp;
temp=memory;
while(temp)
{
if(temp->location==loc)
return temp->contents;
temp=temp->link;
}
store(loc,0);
return 0;
}
void compare(unsigned int num)
{
if(r.h.a<num)
{
r.h.f|=0x95;
r.h.f&=0xbf;
}
else if(r.h.a==num)
{
r.h.f&=0x7e;
r.h.f|=0x54;
}
else
r.h.f&=0x00;
}
void value(unsigned int loc)
{
char str[5];
strcpy(str,"0");
if(check(loc))
{
sprintf(str,"%x",loc);
strrev(str);
while(strlen(str)!=4)
strcat(str,"0");
strrev(str);
strupr(str);
printf("\nLocation:%s",str);
printf("\nEnter Contents?");
scanf("%s",str);
sscanf(str,"%x",&temp);
store(loc,temp);
}
int check(unsigned int loc)

www.solutioncab.com (This is a sample project For BCA Students)


{
struct mem *temp;
temp=memory;
while(temp)
{
if(temp->location==loc)
return 0;
temp=temp->link;
}
return 1;
}
void scanmem()
{
char loc[5],con[3];
unsigned int temp1;
clrscr();
while(1)
{
printf("\n\nEnter-1 to Terminate....");
printf("\nLocation:");
scanf("%s",loc);
if(strcmpi(loc,"-1")==0)
break;
printf("\nContents:");
scanf("%s",con);
if(strcmpi(con,"-1")==0)
break;
sscanf(loc,"%x",&temp);
sscanf(con,"%x",&temp1);
store(temp,temp1);
}
}
void push(unsigned char num)
{
r.x.sp--;
store(r.x.sp,num);
}
unsigned char pop()
{
value(r.x.sp);
temp=load(r.x.sp);
r.x.sp++;
return temp;
}

www.solutioncab.com (This is a sample project For BCA Students)


DATABASE

CODE.DAT
CODE2.DAT

MNEMONICS OPERAND BYTES N-CYCLES T-STATES C-CODE


ACI 8-BIT 2 2 7 0
ADC REG 1 1 4 1
ADC MEM 1 2 7 1
ADD REG 1 1 4 2
ADD MEN 1 2 7 2
ADI 8—BIT 2 2 7 +
ANA REG 1 1. 4 Q
ANA. MEM 1 2 7 Q
ANI 8—BIT 2 2 7 &
CALL 16—BIT 3 5 18 C
CC 16-BIT 3 5 1 C
CNC 16-BIT 3 5 1 C
CP 16—BIT 3 5 1 C
CM 16—BIT 3 5 1 C
CPE 16-BIT 3 5 1 C
CPO 16-BIT 3 5 1 C
CZ 16—BIT 3 5 1 C
CNZ 16—BIT 3 5 1 C
CMA NONE 1 1 4 ~
CMC NONE 1 1 4 V
CMP REG 1 1 4 3
.CMP MEN 1 2 7 3
CPI 8—BIT 2 2 7 A
DAA NONE 1 1 4 B
DAD REG 1 3 10 D
DCR REG 1 1 4 4

www.solutioncab.com (This is a sample project For BCA Students)


DCR MEN 1 3 10 4
DCX REG 1 1. 6 K
DI NONE 1 1 4 Z
EI NONE 1 1 4 Z
HLT NONE 1 2 5 }
IN 8—BIT 2 3 10 z
INR REIG 1 1 4 5
INR MEN 1 3 10 5
INX REGP 1 1 6 I
JMP 16—BIT 3 3 10 J
JC 16—BIT 3 3 1 J
JNC 16—BIT 3 3 1 J
JP 16—BIT 3 3 1 J
JM 16—BIT 3 3 1 J
JPE 16—BIT 3 3 1 J
JPO 16—BIT 3 3 1 3
JZ 16—BIT 3 3 1 J
JNZ 16—BIT 3 3 1 J
LDA 16—BIT 3 4 13 E
LDAX 16-BIT 1 2 7 F
LHLD 16—BIT 3 5 16 G
LXI REGP, 16-BIT 3 3 10 L
MOV REG,REG 1 1 4 6
MOV MEM,REG 1 2 7 6
MOV REG,MEM 1 2 7 6
MVI REG,8-BIT 2 2 7 =
MVI MEN, 8-BIT 2 3 10 =
NOP NONE 1 1 4 Z
ORA REG 1 1 4 7
ORA MEM 1 2 7 7
ORI 8—BIT 2 2 7
OUT 8—BIT 2 3 10 Z
PCHL NONE 1 1 6 0
POP REGP 1 3 10 N

www.solutioncab.com (This is a sample project For BCA Students)


PUSH REGP 1 2 12 P
RAL NONE 1 1 4 ?
RAR NONE 1 1 4 >
RLC NONE 1 1 4 <
RRC NONE 1 1 4 :
RET NONE 1 3 10 R
RC NONE 1 1 1 R
RNC NONE 1 1 1 R
RP NONE 1 1 1 R
RM NONE 1 1 1 R
RPE NONE 1 1 1 R
RPO NONE 1 1 1 R
RZ NONE 1 1 1 R
RNZ NONE 1 1 1 R
RIM NONE 1 1 4 Z
RSTO NONE 1 3 12 }
RST1 NONE 1 3 12 }
RST2 NONE 1 3 12 }
RST3 NONE 1 3 12 }
RST4 NONE 1 3 12 }
RST5 NONE 1 3 12 }
RST6 NONE 1 3 12 }
RST7 NONE 1 3 12 }
SBB REG 1 2 7 T
SBB MEM 1 2 7 T
SBI 8-BIT 2 2 7 _
SHLD 16-BIT 3 5 16 Y
SIM NONE 1 1 4 Z
SPHL NONE 1 1 6 M
STA 16-BIT 3 4 13 S
STAX REGP 1 2 7 #
STC NONE 1 2 4 W
SUB REG 1 1 4 8

www.solutioncab.com (This is a sample project For BCA Students)


SUB MEM 1 2 7 8
SUI 8-BIT 2 2 7 U
XCHG NONE 1 1 4 X
XRA REG 1 1 4 9
XRA MEM 1 2 7 9
XRI 8-BIT 2A 2 7 ^
XTHL NONE 1 5 16 H

MNEMONICS OPERAND HEX


ACI 8-BIT CE
ADC B 88
ADC C 89
ADC D 8A
ADC E 8B
ADC H 8C
ADC L 8D
ADC M 8E
ADC A 8F
ADD B 80
ADD C 81
ADD D 82
ADD E 83
ADD H 84
ADD L 85
ADD M 86
ADD A 87
ADI 8-BIT C6
ANA B AO
ANA C A1
ANA D A2
ANA E A3
ANA H A4
ANA L A5

www.solutioncab.com (This is a sample project For BCA Students)


ANA M A6
ANA 8-BIT E6
CALL 16-BIT CD
CC 16-BIT DC
CNC 16-BIT D4
CP 16-BIT F4
CM 16-BIT FC
CPE 16-BIT EC
CPO 16-BIT E4
CZ 16-BIT CC
CNZ 16-BIT C4
CMA NONE 2F
CMC NONE 3F
CMP B B8
CMP C B9
CMP D BA
CMP E BB
CMP H BC
CMP L BD
CMP M BE
CMP A BF
CPI 8-BIT FE
DAA NONE 27
DAD B 09
DAD D 19
DAD H 29
DAD SP 39
DCR B 05
DCR C OD
DCR D 15
DCR E 1D
DCR L 25
DCR M 2D

www.solutioncab.com (This is a sample project For BCA Students)


DCR A 35
DCX B 3D
DCX D 1B
DCX H 2B
DCX SP 3B
DT NONE F3
EI NONE FB
HLT NONE 76
IN 8-BIT DB
INR B 04
INR C 0C
INR D 14
INR E 1C
INR H 24
INR L 2C
INR M 34
INR A 3C
INX B 03
INX D 13
INX H 23
INX SP 33
JMP 16-BIY C3
JC 16-BIT DA
JNC 16-BIT D2
JP 16-BIT F2
JM 16-BIT FA
JPE 16-BIT EA
JPO 16-BIT E2
JZ 16-BIT CA
JNZ 16-BIT C2
LDA 16-BIT 3A
LDAX B 0A
LDAX D 1A

www.solutioncab.com (This is a sample project For BCA Students)


LHLD 16-BIT 2A
LXI B 01
LXI D 11
LXI H 21
LXI SP 31
MOV B, B 40
MOV B, C 41
MOV B, D 42
MOV B, E 43
MOV B, H 44
MOV B, L 45
MOV B, M 46
MOV B, A 47
MOV C, B 48
MOV C, C 49
MOV C, D 4A
MOV C, E 4B
MOV C, H 4C
MOV C, L 4D
MOV C, M 4E
MOV C, A 4F
MOV D, B 50
MOV D, C 51
MOV D, D 52
MOV D, E 53
MOV D, H 54
MOV D, L 55
MOV D, M 56
MOV D, A 57
MOV E, B 58
MOV E, C 59
MOV E, D 5A
MOV E, E 5B

www.solutioncab.com (This is a sample project For BCA Students)


MOV E, H 5C
MOV E.L 5D
MOV E, M 5E
MOV E, A 5F
MOV H, B 60
MOV H, C 61
MOV H, D 62
MOV H, E 63
MOV H, H 64
MOV H, L 65
MOV H, M 66
MOV H, A 67
MOV L, B 68
MOV L, C 69
MOV L, D 6A
MOV L, E 6B
MOV L, H 6C
MOV L, L 6D
MOV L, M 6E
MOV L, A 6F
MOV M, B 70
MOV M, C 71
MOV M, D 72
MOV M, E 73
MOV M, H 74
MOV M, L 75
MOV M, A 77
MOV A, B 78
MOV A, C 79
MOV A, D 7A
MOV A, E 7B
MOV A, H 7C
MOV A, L 7D

www.solutioncab.com (This is a sample project For BCA Students)


MOV A, M 7E
MOV A, A 7F
MVI B 06
MVI C OE
MVI D 16
MVI E 1E
MVI H 26
MVI L 2E
MVI M 36
MVI A 3E
NOP NONE 00
ORA B BO
ORA C B1
ORA D B2
ORA E B3
ORA H B4
ORA L B5
ORA M B6
ORA A B7
ORI 8-BIT F6
OUT 8-BIT D3
PCHL NONE E9
POP B C1
POP D D1
POP H E1
POP PSW F1
PUSH B C5
PUSH D D5
PUSH H E5
PUSH PSW F5
RAL NONE 17
RAR NONE 1F
RLC NONE 07

www.solutioncab.com (This is a sample project For BCA Students)


RRC NONE OF
RET NONE C9
RC NONE D8
RNC NONE D0
RP NONE F0
RM NONE F8
RPE NONE E8
RPO NONE E8
RZ NONE E0
RNO NONE C8
RIM NONE C0
RSTO NONE 20
RST1 NONE C7
RST2 NONE CF
RST3 NONE DF
RST4 NONE E7
RST5 NONE EF
RST6 NONE F7
RST7 NONE FF
SBB B 98
SBB C 99
SBB D 9A
SBB E 9B
SBB H 9C
SBB L 9D
SBB M 9E
SBB A 9F
SBI 8-BIT DE
SHLD 16-BIT DE
SIM NONE 30
SPHL NONE F9
STA 16-BIT 32
STAX B 02

www.solutioncab.com (This is a sample project For BCA Students)


STAX D 12
STC NONE 37
SUB B 90
SUB C 91
SUB D 92
SUB E 93
SUB H 94
SUB L 95
SUB M 96
SUB A 97
SUI 8-BIT D6
XCHG NONE E8
XRA B A8
XRA C A9
XRA D AA
XRA E AB
XRA H AC
XRA L AD
XRA M AE
XRA A AF
XRI 8 BIT EE
XTHL NONE E3

8. SECURITY

www.solutioncab.com (This is a sample project For BCA Students)


The dictionary definition of security encompasses a set of measures taken to guard against theft,
attack, crime, and espionage or sabotage. Security implies the quality or state of being secure, that
is, a relief from exposure to danger and acting so as to make safe against adverse contingencies.

SECURITY/POLICIES AND MECHANISMS


Security policies specify what is desired in terms of protection Security mechanisms specify how
to effect the security policies-'and them in a given system.
The primary objective of operating systems and of the systems software provide a flexible and
functionally complete set of security mechanisms in order to enable users and owners of
information to enforce security policies as they see fit.

Security Policies
Security policies have probably been around since the accumulation of the first valuables that
needed guarding. They usually encompass procedures and processes that specify

1. How information can enter and exit the system


2. Who is authorized to access what information and under what conditions
3. What are the permissible flows of information within the system?

Additional limitations, such as restricting database queries about too large or too small sets,
can be imposed to reduce the danger of deducing data by statistical inference. Security policies are
often guided by the age-old principles of:
• Least privilege. Each subject should be allowed access only to the information essential for
completing the tasks that the subject is authorized to. For example, hospital accountants need not
have access to the patient's medical records, and doctors do not have to be allowed access to the
accounting data.
Regarding the project or s/w “Assembly compiler using C” security is not an important topic to
concern. The only damage that one may cause is that of change in the code of the project. As the
code is not hidden from the user we may count it is a limitation of this project. Unauthorized
access of others data are taken by this program must be stored in a unique file (it is compulsory) as
it cannot take input directly. Even time to compile a new program the old dates are to be removed
and the current data’s are to be entered same in the case of output.
Password security or the login check makes will eliminate the user friendliness of the
project. As every one have code to run but not the password to enter.

9. TESTING

www.solutioncab.com (This is a sample project For BCA Students)


SAMPLE RUN 1
SAMPLE1.ASM
0RG8800:
LXI H,2501 ; largest of two numbers
MOV A,M
INX H
CMP M
JNC AHEAD
MOV A,M
AHEAD: STA 2503
HLT
Input Result
PROGRAM COUNTER:8800 2503-EB
Location:2501
Contents? A9

Location:2501
Contents?EB

SAMPLE RUN 2
SAMPLE2.ASM

ORG8800:
LXI H, 2501:largest of two number
MOV A,M
INX H
CPM M
JNC AHEAD
MOV A,M
AHEAD: STA 2503

www.solutioncab.com (This is a sample project For BCA Students)


HEX CODEFILE:
SAMPL1.HEX
SAMPLE2.HEX

ADDRESS LABEL MNEMONIC OPERAND HEX 2-BYIE 3-BYTE


8800 LXI H,2501 21 01 25
8803
8803 MOV A,M 7E
8804 INX H 23
8805 CMP M BE
8806 JNC AHEAD D2 0a 88
8809 MOV A,M 7E
880A AHEAD
880A STA 2503 32 03 25
880D HIT 76

INTERMEDIATE RESULT FILE:


STEP.DAT
MNEMONIC OPERAND A B C D E H L S Z AC P CY
LXI H,2501 00 00 00 00 00 25 01 0 0 0 0 0
MOV A,M A9 00 00 00 00 25 01 0 0 0 0 0
INX H A9 00 00 00 00 25 02 0 0 0 0 0
CMP M A9 00 00 00 00 25 02 1 0 1 1 1
JNC AHEAD A9 00 00 00 00 25 02 1 0 1 1 1
MOV A,M EB 00 00 00 00 25 02 1 0 1 1 1
STA 2503 EB 00 00 00 00 25 02 1 0 1 1 1
HLT NONE EB 00 00 00 00 25 02 1 0 1 1 1

10.OUTPUT
www.solutioncab.com (This is a sample project For BCA Students)
FINAL RESULT OUTPUT FILE:
RESULT.DAT

STATUS OF REGISTERS:

A=EB B=00 C=00 D=00 E=00 H=25 L=02

STATUS OF FLAGS:

S=1 Z=0 AC=1 P=1 CY=1

STATUS OF MEMORY LOCATIONS:

Location :2501 Contents:A9

Location:2502 Contents: EB

Location:2503 Contents:EB

www.solutioncab.com (This is a sample project For BCA Students)


11 . LIMITATION OF THE PROJECT

• Error debugging is incorporated in this project which enhance its flexibility.

• Some opcode are not run or understandable by the C compiler

• C compiler is must

• Assembly language program or the source program must be stored in a particular file

• Every new output clear the previous out put by default

www.solutioncab.com (This is a sample project For BCA Students)


12. FUTURE APPLICATION OF THE PROJECT

This project is very useful for education purpose as well as for writing an Assembly language

program(8085) for an 8085 Microprocessor Based System. One can save his\her time by running

an Assembly Language Program using this package. If it run correctly than he\she can code and

run it for Microprocessor Based system

Further development in this code gives a very better environment for

Thecompilation of the assembly language programs

www.solutioncab.com (This is a sample project For BCA Students)


13 . BIBLIOGRAPHY

 LET US C

BY YASHWANT KANITKAR

 UNDERSTANGING POINTERS IN C

BY YASHWANT KANITKAR

 MICROPROCESSOR ARCHITURE PROGRAMMING APPLICATION

WITH 8085/8080A

BY RAMESH S. GAONKAR

 FUNDAMENTAL OF MICROPROCESSOR &MICROCOMPUTER

BY B.RAM

 C PROJECTS

BY YASHWANT KANITKAR

www.solutioncab.com (This is a sample project For BCA Students)

You might also like