Phone Directory Management system with documentation in MIPS

 Phone Directory Management system with documentation

Introduction:

 

                       My management system is based in assembly language MIPS. So, I made a phone directory as a management system using MIPS and the uses of this management system is time that first, the main thing is this that it is more faster than the other management system because this is based on the MIPS and MIPS is more faster than the other programming languages because this is more closer to processor. In other programming languages compilers convert the code firstly into the assembly language with the help of assembler and then machine code therefore this is faster than this saves this time which other programming languages uses. And this is the biggest advantage of this management system and the other advantage is this that this is more optimized than the other programming languages because this consumes less memory because in this management system there is nothing extra instructions and less data consuming instructions. You can get a good user relationship between software and user.

So, therefore this management system is more convenient than the others in term of speed, memory and functionalities.

 

 

Functionalities/Design:

                             Now we will talk about the functionalities about this management system and the functionalities of this management system are that this management system can add, remove, read, search, and modify the data of any person. There is lots of the functionality with optimization. So now I will explain the functionalities below

 

·       Add-Data:

                  To add the data I made a function in this management system which will add the phone number, name, address, CNIC and id of the customer I made ID to integer and the remaining element to the string. And while taking the input I stored the address of string inside and character array and then I store the address of this array inside to the new array and for id I used only one array and take the input which will store inside the register and then I will store the address of this register inside the array. For string I increment the array with 8 bits which means that the character array will take the input of 8 bits. Every character contains the 1 bit which means that only 8 characters will store inside the array to increase the character we will increase the number bits which we increments. So, this is little bit tricky to take the input from the user which we can understand after checking the code.

 

 

·       Show Data:

                          Showing the data inside this management system is very easy. I made a function to show the all data which is stored inside this management system. In this function I will remove the all elements which is stored inside the arrays and store this data into the registers and then show this data and for the next index of arrays program will repeat the same part again until array will empty.

So this function is very easy to understand.

 

 

·       Search Data:

                         To search the data I made another function and I will repeat the same process of the show function and then add the condition there if the id inside the array will equal to expected id than program will show the data which is stored inside the array if data will not found than program will tell that there is no data. So this function is also easy.

 

 

·       Modify Data:        

                             To modify the data I made another function and repeat the functionality of the search function if we will find the id which we want to modify than we will take the new input from the user and then store it into the registers and character arrays after this we will shift the address of the data inside the new array at the same index as the user tells. So in this way modify function works.

 

·       Delete Data:    

                            To delete the data I made another function named as delete this function will delete the data according to the user requirement. And working of this function is in this way that I store the null address inside the one register and 0 inside the another register after this I will perform the same working as the search operation performs which we will find the data which user wants then I will store the null inside the string address and zero inside the integer. So this is the easy working of the delete function if we will not find the data than we will print the message that we cannot find the data.

 

Hope you will understand this functionality of this management system.

 

 

 

Program objectives:

                                                   The objective of this program that we can store and manage the data inside this program and perform various operations which can be difficult for a simple person because if we manages the lot of  the data than it can be difficult for a normal human but a program can manage this data easily. Not only is this probability of error inside program less than the normal human.

 

                         

Source Code:   

       
 .data

inName:.asciiz"\nEnter the name:"

inPhone:.asciiz"\nEnter the phone number:"

inId:.asciiz"\nEnter the Id:"

inAddr:.asciiz"\nEnter the address:"

notF:.asciiz"\nThere is no data\n"

showN:.asciiz "\nName is:"

showP:.asciiz"\nPhone number is:"

showA:.asciiz"\nAdress is:"

showId:.asciiz"\nId is:"

endl:.asciiz"\n"

space:.asciiz" "

strN:.space 100

arrN:.space 40

strP:.space 100

strAd:.space 100

arrId:.space 40

arrAd:.space 40

arrP:.space 40

option:.asciiz "\npress 1 for input\npress 2 for show\npress 3 for search\npress 4 for delete\npress 5 for modify\npress other key to cancel\n"

NoId:.asciiz"\nIncorrect id\n"

DelS:.asciiz"\nDeleted Successfully\n"

Null:.asciiz"0"

small:.asciiz"\nPlease use less than 8 charecters while entering data\n"

Management:.asciiz"\n********Sample Management System******\n"

Practice:.asciiz"\n-------------for beginers--------------\n"

Mod:.asciiz"\nData is Modified\n"

.text

li $t1,0

# t1,t2,t3,t4,t5,t6,t7,t8,t9,s0,s1,s2,s3,s4,s5

li $s0,1

li $t5,1

li $t6,2

li $t8,3

li $t9,4

li $s5,5

main:

li $v0,4

la $a0,Management

syscall

li $v0,4

la $a0,Practice

syscall

li $v0,4

la $a0,option

syscall

li $v0,5

syscall

move $s1,$v0

beq $s1,$t5,test

beq $s1,$t6,show

beq $s1,$t8,search

beq $s1,$t9,delete

beq $s1,$s5,Modify

syscall

li $v0,10

syscall

 

test:

li $v0,4

la $a0,small

syscall

li $v0,4

la $a0,inName

syscall

li $v0,8

la $a0,strN($t1)

li $a1,100

syscall

sw $a0,arrN($t1)

 

li $v0,4

la $a0,inPhone

syscall

li $v0,8

la $a0,strP($t1)

li $a1,100

syscall

sw $a0,arrP($t1)

 

li $v0,4

la $a0,inAddr

syscall

li $v0,8

la $a0,strAd($t1)

li $a1,100

syscall

sw $a0,arrAd($t1)

 

li $v0,4

la $a0,inId

syscall

li $v0,5

syscall

sw $v0,arrId($t1)

addi $t1,$t1,8

j main

syscall

 

show:

li $t2,0

inShow:

beq $t2,$t1,main

li $v0,4

la $a0,showN

syscall

lw $t7,arrN($t2)

li $v0,4

move $a0,$t7

syscall

li $v0,4

la $a0,showP

syscall

lw $t7,arrP($t2)

li $v0,4

move $a0,$t7

syscall

li $v0,4

la $a0,showA

syscall

lw $t7,arrAd($t2)

li $v0,4

move $a0,$t7

syscall

li $v0,4

la $a0,showId

syscall

lw $t7,arrId($t2)

li $v0,1

move $a0,$t7

syscall

addi $t2,$t2,8

j inShow

syscall

 

 

search:

li $t3,0

li $v0,4

la $a0,inId

syscall

li $v0,5

syscall

move $s2,$v0

inSearch:

beq $t3,$t1,No

lw $t4,arrId($t3)

beq $s2,$t4,SId

addi $t3,$t3,8

j inSearch

syscall

 

SId:

li $v0,4

la $a0,showN

syscall

lw $s3,arrN($t3)

li $v0,4

move $a0,$s3

syscall

li $v0,4

la $a0,showP

syscall

lw $s3,arrP($t3)

li $v0,4

move $a0,$s3

syscall

li $v0,4

la $a0,showA

syscall

lw $s3,arrAd($t3)

li $v0,4

move $a0,$s3

syscall

li $v0,4

la $a0,showId

syscall

lw $s3,arrId($t3)

li $v0,1

move $a0,$s3

syscall

j main

syscall

 

No:

li $v0,4

la $a0,NoId

syscall

j main

syscall

 

 

 

 

delete:

li $t3,0

li $v0,4

la $a0,inId

syscall

li $v0,5

syscall

move $s2,$v0

inDel:

beq $t3,$t1,No

lw $t4,arrId($t3)

beq $s2,$t4,SDel

addi $t3,$t3,8

j inDel

syscall

 

SDel:

la $s3,Null

li $s4,0

sw $s3,arrN($t3)

sw $s3,arrP($t3)

sw $s3,arrAd($t3)

sw $s4,arrId($t3)

li $v0,4

la $a0,DelS

syscall

j main

syscall

 

 

Modify:

li $t3,0

 

li $v0,4

la $a0,inId

syscall

li $v0,5

syscall

move $s2,$v0

inMod:

beq $t3,$t1,No

lw $t4,arrId($t3)

beq $s2,$t4,SMod

addi $t3,$t3,8

j inMod

syscall

 

SMod:

 

li $v0,4

la $a0,inName

syscall

li $v0,8

la $a0,strN($t3)

li $a1,100

syscall

sw $a0,arrN($t3)

 

li $v0,4

la $a0,inPhone

syscall

li $v0,8

la $a0,strP($t3)

li $a1,100

syscall

sw $a0,arrP($t3)

 

li $v0,4

la $a0,inAddr

syscall

li $v0,8

la $a0,strAd($t3)

li $a1,100

syscall

sw $a0,arrAd($t3)

 

li $v0,4

la $a0,inId

syscall

li $v0,5

syscall

sw $v0,arrId($t3)

li $v0,4

la $a0,Mod

syscall

j main

syscall

       
 





Conclusion:

                              So the conclusion for this management system is that this program contains various functionalities for example add data, delete data, modify data, delete data, show data and this contain optimized code according to speed and memory. Therefore, I explain everything which I used inside the program and also after brief explanation this is the simple conclusion.


Comments

Popular posts from this blog

Multiple inheritance,friend function and multiple file in oop(object oriented programming)

Concepts of OOP (object oriented programming)

Concepts in c++........