8085 MICROPROCESSOR SIMULATOR

INDEX

1. ACKNOWLEDGEMENT 2. AIMS AND OBJECTVES 3. INTRODUCTION 4. METHODOLOGY a. INTRODUCTION TO 8085 b. EVOLUTION c. PROGRAMMING LANGUAGES

d. INSTRUCTION SET OF 8085 e. 8085 SIMULATOR f. NEEDS AND BENIFITS OF 8085 SIMULATOR

g. SOFTWARES USED

5. FUTURE PROSPECTS 6. REFERENCES

ACKNOWLEDGEMENTS
We acknowledge our debt to those who have contributed significantly to this project. We would like to express our deep gratitude to Dr. A. K Ramani (Director,IIPS),Dr. K.N Saxena (Coordinator MCA), ,Mr.Imroz Khan for their valuable guidance and support for providing us a good working environment. We would also like to thank them for the useful tips in improving the project and also for pointing out our mistakes and also our shortcomings from time to time which is still guiding us forward. This acknowledgement would be incomplete without the name of our project guide Ms. Richa Gupta Tiwari for her helpful solution and comments enriched by her experience which improved our ideas for the betterment of the project and sincerely acknowledge that without her support we would not have reached this stage.

AIM AND OBJECTIVES
Our aim is to create a user friendly and intuitive Simulator under Windows, for the 8085 processor. It offers complete transparency at the Register, Flag and Stack level. Easy coding through a Code Key Pad with complete input validation. Offers easy and extensive debugging. User with no extensive knowledge of 8085 can effectively use this tool. The software is a very flexible, reliable, easy to use pedagogical tool which could be very effectively used to supplement a course on microprocessor/computer organization as a learning aid. Our objective is to create a easy to use simulator by implementing
q

q

q q q

q

Absolute Transparency in functioning of the Microprocessor at Register and Flag levels. Constantly displays the contents of all the memory locations that are relevant to a program. Quick assembly language programming saving great amount of time and efforts. Indispensably useful for Learning and Teaching purposes. Makes writing machine code programs really easy because in this Simulator you just click at buttons for the mnemonics and everything else is done automatically. Extensive and user friendly Debugging facilities.

q

q

q

Shows all Stack Activities and the status of Program Counter distinctly and even permits the user to inspect the Stack Area of the memory dynamically at run time. The user is allowed to choose his own Start Address and Stack location as per his requirement. Total input validation - The beginner is guided all along by this well designed and intelligent Simulator, to a stage that we can say that it is almost impossible to commit a mistake.

INTRODUCTION

MICROPROCESOR When the components of a CPU can be integrated on a single chip then it is called a

microprocessor. Our project deals with the 8085 microprocessor. The computers using the microprocessor and the additional peripherals is called as microcomputer.

MICROPROCESSOR SIMULATOR The 8085 Microprocessor Simulator is a total software solution to replace the microprocessor kit from training and design labs. The Simulator executes the instructions from the user entered program, instruction by instruction showing all the register and flag status at the end of execution of each instruction SOFTWARES Visual basic – 6 Microsoft Visual Basic is probably the fastest and easiest way to create applications for Microsoft Windows. Visual Basic provides you with a complete set of tools to simplify rapid application development. MS Access

A full- featured procedural programming language —preferably a subset of Visual Basic. It is a powerful database-handling tool and acts as a efficient backend to most of the front-end applications which include Visual Basic too.

METHODOLOGY
8085 MICROPROCESSOR SIMULATOR

Introduction to 8085 The 8085 is a complex IC of sequential circuits. The sequential circuits are designed to do some operation depending on what is the input on their lines. The vital inputs on the lines are what therefore determine what operation will be done by the sequential circuits inside it. The operations can be very complex and therefore this chip is also called a processor. Since we can find a way to put different values of inputs to the input lines of the processor at different times, we can make it execute different operations in a sequence that we desire. Thus, in other words we can make the processor execute a program to do useful things for us. These inputs then could alternately, be called

instructions. The program that we desire to be executed must be loaded into consecutive locations of memory chips. The memory is not part of the 8085 processor. The memory chips are again sequential circuits consisting of flip-flops that are capable of storing digital values. Since we would be interested in storing a huge number of such digital values, a large number of these memories are packed together with a scheme of addresses, so that we can address them individually. Generally the memories are arranged in large numbers of 8 bit bunches each. The 8085 has a address bus which is 16 bit wide. Therefore it can put 2^16 different digital values on it, and therefore it can address a maximum of 2^16 different address locations. This is called the addressing space and it is 64 kilobyte for the 8085, because 2^16= 65535. And then we ask the processor to execute those instructions from a particular memory location onwards. It goes on executing those instructions one after another. The processor uses certain internal memory locations called Registers in doing all the operations that we ask it to do. The contents of those memory locations can be directly altered by the instructions that we give. Evolution INTEL Corp. is generally recognized as the company that introduced the microprocessor successfully in the market. The first microprocessor, the 4004 was introduced in 1971.It

was a central component in the chip set, called MCS-4. The microprocessors introduced between 1971 and 1973 were the first generation systems. They used PMOS technology, which provided low cost, slow speed and low output currents. After 1973-second generation microprocessors such as Motorola 6800 and 6809,Intel 8085 evolved. They were fabricated using NMOS technology. After 1978 The third generation microprocessors were evolved. They were 16 bit wide and included Intel 8086/80186/80286.They were designed using HMOS technology. In 1980 the fourth generation microprocessors evolved. Since 1985,32 bit microprocessors are fabricated using low power version of HMOS technology called HCMOS and they include an on-chip RAM called cache memory to speed up program execution. So extensive research is being carried out for the implementation of more on-chip functions and for the improvement of the speeds of memory and I/O devices. Programming Languages Programming is basically running a set of well-defined instructions in a syntactical manner to solve a particular task/problem. Microcomputer programming languages can typically be segmented as: 1.Machine Language

2.Assembly Language 3.High-level Language Machine Language: A machine language program consists of either binary or hexadecimal OP(operation) codes. Eight bit microcomputers can be programmed using machine language. A microprocessor has a unique set of machine language instructions defined by the manufacturer. No 2 microprocessors have same machine language instruction set. Assembly Language: Assembly Language uses semi-English statements for 8 bit microprocessors. Each instruction in an assembly language comprises: (a) Label Field (b) Instruction, Mnemonic or Op-code field (c) Operand field (d) Comment field

Assembly language basically consists of programs written with the help of mnemonics Mnemonic is a combination of letters to suggest the operation of an instruction. In general an instruction has 2 components-operation code (OP-code) field and Address field. The OP-code field specifies how data is to be manipulated and the purpose of the address field is to indicate the address of a data item. .High- Level Language Most 16 and 32 bit microprocessors in addition to assembly and machine language use a more understandable human oriented language called high-level language. High level language programs are composed of English language type statements .a no of high-level language. Regardless of what type of language is used to write a program, the microcomputers understand only binary numbers. So the programs must eventually be translated into their appropriate binary forms. An assembler is one such translator that translates a program written in assembly language to machine language (object code). A compiler/an interpreter converts a high-level language program into a machine language one. A compiler translates the entire source code to object code and then executes it. On the other hand, the interpreter performs line-by-line translation and execution

simultaneously like FORTRAN, COBOL, BASIC, C, C++ are widely used these days.

INSTRUCTION SET
• DATA TRANSFER GROUPS:

These groups include the move, exchange, load, and store operations. Data transfer instructions are among the most widely used of all microprocessor instructions. This group of instructions transfers data to and from registers and memory. None of the instructions of this group are the flag affecting instructions. The instructions included in this group are MOV, MVI, LXI, LDA, STA, LHLD, SHLD, LDAX, STAX, and XCHG For e.g.: MOV (A, B) will move the contents of register B to register A. • ARITHEMATIC GROUPS:

This group includes the add, add with carry, subtract, subtract with borrow, increment, decrement, and decimal adjust accumulator operations. This group of instructions

performs arithmetic operations on data in registers and memory. Unless indicated otherwise all the instructions are flag affecting instructions. All subtraction operations are performed via 2s complement arithmetic and set the carry flag to 1 to indicate a borrow and clear it to indicate no borrow. The instructions included in this group are ADD, ADC, SUB, SBB, DAD, INR, INX, DCR, DCX, and DAA. For e.g.: ADD B will add the contents of register B to the contents of register A and store the result in A. • LOGICAL GROUPS

This include AND, OR, XOR, compare, rotate and complement instructions. This group of instructions performs Logical (Boolean) operations o the data in registers and memory and on flags. The instructions include in the group are ANA, XRA, ORA, CMP, AI, XRI, ORI, CPI, RLC, RRC, RAR, RAL, CMA, STC and CMC. For e.g.: ANA C will logically AND the contents of register C with the contents of register A and store the result in A.

BRANCHING GROUPS:

This include jump, call, return and restart instructions. This group of instructions alters the normal sequential program flow. The to types of branch instructions are: -Unconditional -Conditional Unconditional transfers simply perform the specified operation o the program counter. Conditional transfers examine the status of one of the four MPU flags to determine whether the specified branch is to be executed. The instructions include in the group are Unconditional – JMP, RET, CALL, RST 0, RST 1, RST 2, RST 3, RST 4, RST 5, RST 6, RST 7, PCHL. Conditional - JNZ, JZ, JNC, JC, JPO, JPE, JP, JM, CNZ, CZ, CNC, CC, CPO, CPE, CP CM, RNZ, RZ, RNC, RC, RPO, RPE, RP, RM. For e.g.: JMP 4000 will transfer the program flow to the memory location 4000.

• STACK, I/O AND MACHINE CONTROL INSTRUCTIONS: This include push and pop, input and output, exchange, interrupt enables and disables, no operation and halts, and multi – purpose read and set interrupt mask instructions. This group of instructions performs inputs and outputs, manipulates the stack, alters the internal control flags. The instructions included in the group are: Stack operations – PUSH, POP, XTHL, and PCHL Control operations. – DI, EI, NOP, HLT, RIM, SIM Input/output operations - OUT and IN For e.g.: PUSH B will push the contents the register B to the stack which is initialised previously.

THE 8085 SIMULATOR
The 8085 Microprocessor Simulator is a total software solution to replace the microprocessor kit from training and design labs. The Simulator executes the instructions from the user entered program, instruction by instruction showing all the register and flag status at the end of execution of each instruction. The input process is

fast and efficient, leading to better productivity. The Mnemonic Pad allows the user to enter the code. This makes is impossible to enter a wrong Mnemonic. The Tool tips tell you the syntax along with the operation performed by a particular Mnemonic. The Data Entry Window allows you to enter the Data Segment of your code. This is provided to enable the user to enter the data once and save it along with the code

Need for 8085 Simulator –Difficulties faced by microprocessor kit:
The 8085 Microprocessor is the basic microprocessor taught to students first all over the world. The concepts of how microprocessor can be well understood in this basic chip. The same concepts can be very easily extended to advanced processors like the 8086, 80286, 80386, 80486 or the Pentium processor. Today, students write their code in machine code in a Microprocessor kit which is a piece of hardware with keys that very often develop key debounce problems. After an hour of painful machine code entry the program is executed and the student is left clue less about where his problem just went on an infinite loop. Since he can not save his program he goes home for the day and goes over the entire exercise again the next day. It just steals away the fun from the Microprocessors. In this simulator all that is History. He just clicks on the mnemonics and the machine code is written for him. Then he can debug the program by executing

Step by Step. All the register states, flag states, memory dump, I/O Dump, Stack Locations, M/c Cycle and T-States taken, are clearly shown in a tabular fashion at the completion of each instruction. This package eliminates the need for the expensive hardware setup. Online facility to simulate programs helps students to have hands on experience of programming.

Benefits Of Simulators:
1.Safety While there are many things that can actually be done without needing a computer simulation, there are also a large number of activities that are best left to computers before physically doing them due to the risks involved. First of all, there are some things like, surgery, which if extremely difficult, are best left to a computer to attempt the procedure first before actually risking the life of another person.

2. Monetary Issues

Obviously, there is a lot of cost involved when implementing any actual real life scenario, such as flying a plane, or building a new interstate highway system, so by using computers, we are able to drastically undercut prices and costs of the activities 3.Visualisation

Large amounts of people are visual learners. That is important to keep in mind when dealing with the benefits of computers, because they are primarily visual tools. Scientists definitely use the visualization aspect in their research. In fact, scientists are able to look at something as small as strands of DNA using a computer simulation program, which make them big enough to really observe and study. 4.Projection This aspect of computer simulation actually relates back to the visualization concept in that because a computer simulation can speed up time, the user is able to determine effects of any given variable on the control. The ability to speed up time is especially beneficial because cause and effect relationships are much easier to demonstrate and understand 5.Replication As any researcher knows, it can be quite difficult to get the exact same situation more than once. So, by using a computer model the user can replicate the exact same conditions time after time. In real life situations, this attempt at replication is not viable, so researchers and users do the best with what they have, but by using a computer, not only is perfect repetition possible, but it is also practical.

Disadvantages Of Simulators
1.Accuracy Of The Model The problem with computer simulations is that their accuracy in determining what will actually happen next in a real life situation, depends solely on how well he model was made to begin with. If the model actually doesn't follow the real life situation closely, then simulating it will do the user no good, but if the model closely resembles the "real world", then it can be quite valuable. Because many if not all, models are based off of assumptions, they can be very difficult to actually verify or qualify. Within this framework, there is a very high chance for error, either mathematical, or personal, and because of that computers are not perfect predictors. The problem is that it can be hard to find or discover these errors, so many simulators or models could contain them, and no one would know until the real life situation came along and the results are not the same as predicted. 2.Computers Not Free From Error The biggest problem is that people take computers to be somewhat "God-like" in that whatever their answer is, that must be the truth, because computers don't lie. It is the information given in these computers reports of simulations that people base so many of their decisions. Decisions and choices that are more than just minor details, but also decisions which affect millions of dollars, lives, or amount of production, to name a few.

People trust computers because they believe that anything a computer generates, must be true because it is a machine, and therefore incapable of misinterpreting something, or forgetting about something

Visual Basic 6
Microsoft Visual Basic is probably the fastest and easiest way to create applications for Microsoft Windows. Visual Basic provides you with a complete set of tools to simplify rapid application development. The "Visual" part refers to the method used to create the graphical user interface (GUI). Rather than writing numerous lines of code to describe the appearance and location of interface elements, you simply add pre built objects into place on screen so you can put in all your programming skills in the real application part. The "Basic" part refers to the BASIC (Beginners All-Purpose Symbolic Instruction Code) language, a language used by more programmers than any other language in the history of computing. Visual Basic has evolved from the original BASIC language and now contains several hundred statements, functions, and keywords, many of which relate directly to the Windows GUI. Beginners can create useful applications by learning just a few of the keywords, yet the power of the language allows professionals to accomplish anything that can be accomplished using any other Windows programming language.

Whether your goal is to create a small utility for yourself or your work group, a large enterprise-wide system, or even distributed applications spanning the globe via the Internet, Visual Basic easily accomplishes using the following tools.
q

Data access features allow you to create databases, front-end applications, and scalable server-side components for most popular database formats, including Microsoft SQL Server and other enterprise-level databases. ActiveX technologies allow you to use the functionality provided by other applications, such as Microsoft Word word processor, Microsoft Excel spreadsheet, and other Windows applications. Internet capabilities make it easy to provide access to documents and applications across the Internet or intranet from within your application, or to create Internet server applications. Your finished application is a true .exe (executable) file that uses a Visual Basic Virtual Machine that you can freely distribute.

q

q

q

Structure of a Visual Basic Application
An application is really nothing more than a set of instructions directing the computer to perform a task or tasks. The structure of an application is the way in which the instructions are organized; that is, where the instructions are stored and the order in which instructions are executed. Simple applications have a simple structure; organization isn't very important with a few lines of code. As applications become more complex, the need for organization or structure becomes obvious. In addition to controlling the execution of an application, the structure is important to the programmer: how easily can we find specific instructions within our application? This is what we have tried to make sure that in our application that the user gets a clear view of the different types of instructions in 8085 Microprocessor, and each set of instructions has its own module. Because a Visual Basic application is based on objects, the structure of its code closely models its physical representation on screen. By definition, objects contain data and code. The form that you see on screen is a representation of the properties that define its appearance and intrinsic behavior. For each form in an application, there is a related ‘form module’ that contains its code. For each control on a form, there is a corresponding set of event procedures in the form module. In addition to event

procedures, form modules can contain general procedures that are executed in response to a call from any event procedure. There is also provision for code that isn't related to a specific form or control so that code is not repeated in all the modules but easily called from the common module. By default each project contains a single form module. We can add additional form, class, and standard modules, as needed. The Structure of a Visual Basic Project Form modules contain the textual descriptions of the form and its controls, including their property settings. They can also contain form-level declarations of constants, variables, and external procedures; event procedures; and general procedures. Class modules are similar to form modules, except that they have no visible user interface. You can use class modules to create your own objects, including code for methods and properties.

Components In addition to files and modules, several other types of components can be added to the project. ActiveX Controls ActiveX controls are optional controls which can be added to the toolbox and used on forms. Insertable Objects, such as a Microsoft Excel Worksheet object, are components you can use as building blocks to build integrated solutions. Standard Controls Standard controls are supplied by Visual Basic. Standard controls, such as the command button or frame control, are always included in the toolbox, unlike ActiveX controls and insertable objects, which can be removed from or added to the toolbox.

How an Event-Driven Application Works

An event is an action recognized by a form or control. Event-driven applications execute Basic code in response to an event. Each form and control in Visual Basic has a predefined set of events. If one of these events occurs and there is code in the associated event procedure, Visual Basic invokes that code. Although objects in Visual Basic automatically recognize a predefined set of events, it is up to us to decide if and how they will respond to a particular event. The types of events recognized by an object vary, but many types are common to most controls. For example, most objects recognize a Click event — if a user clicks a form, code in the form's Click event procedure is executed; if a user clicks a command button, code in the button's Click event procedure is executed. The actual code in each case will most likely be quite different.

What is MS ACCESS
• A full- featured procedural programming language —preferably a subset of Visual Basic • A simplified procedural macro language unique to Access; •A rapid application development environment complete with visual form and

report development tools •Various wizards and builders to make development easier. The database file in Access The term “database” means different things depending on the DBMS used. For example in dBase IV, a database is a file containing a single table. Forms and reports are also stored as individual files with different extensions. The net result is a clutter of files. In contrast, an Oracle database has virtually no relationship to individual files or individual projects. For instance, a database may contain many tables from different projects/ applications and may also be stored split into one or more files Access strikes a convenient balance— all the “objects” (tables, queries, forms, reports, etc.) for a single project/ application are stored in a single file.Much larger than you might expect given the amount of data. Compacting the database from time to time eliminates fragmentation and can dramatically reduce the disk space requirement of your database. FUTURE PROSPECTS: Our project does not only encompass the simulator but you can say that the simulator is just one part of it. Our project will give the comprehensive and detailed information of each and every

aspect of 8085 microprocessor It would be including: • Microprocessor architecture It would present common microprocessor characteristics explaining how actually the instructions are fetched, decoded and executed in the actual 8085 microprocessor, with the help of block diagrams and the pin outs of the 8085. • Interfacing This part of the project would elaborate as to how the peripherals work in synchronization with the microprocessor thus sharing information. The peripherals include the I/O devices as well as the memory (RAM and ROM). This interconnection or linkage with the microprocessor is termed as interfacing.

Comprehensive help The already implemented simulator would be enhanced so as to provide an extensive help on all the instructions with a suitable warning on any illegal operation so that the chances of errors are not only minimized but can be totally eradicated. To make it more user friendly we would incorporate speech facility. •

REFERENCES:
“8080A-8085 Assembly Language Programming” Lance A Leventhal q "Microprocessors and Microcomputers--Hardware and Software" Fifth Edition by Ronald J.Tocci ,Prentice Hall, Upper Saddle River, New Jersey. q “Microprocessor Fundamentals” Second Edition by Roger L. Tokheim q “Access 2000 For Windows For Dummies –Quick Reference “by Alison Barrows q “Mastering VB6 “ by Evangelos Petroutsos q “The Complete Reference VB6” by Noel Joke q “Murach’s VB76” by Ed Copp,Anne Prince and Joel Murach URL’s q www.vbcity.com q www.vb-world.net
q

PARTICIPANTS GARIMA GUPTA (MCA V SEM) GARIMA MAHADIK (MCA V SEM) KAPIL SETHI (MCA V SEM)

Sign up to vote on this title
UsefulNot useful