Friday, 30 September 2022

Bharat College C Programming 1st Unit

 

Program Concept: Rapid technological advances in computer hardware have heightened the desire by business to purchase computers. Once a computer is purchased, a company must either develop or purchase the software to process the input data and produce the desired information. A problem will never be presented to a computer if it is not realized that the problem is a candidate for a computer solution. Therefore, in the beginning, there is an uneasy feeling that something needs attention. For example, a manager may be concerned that sales are dropping or that the cost of maintaining an inventory of parts is rising. A natural tendency is to have a computer to solve the problem. But what is the problem? Can a computer actually help solve it? Framing the exact problem for the computer to solve, is an important step in presenting a job to the computer. It is a must to be aware of what the problem actually is.

               Coding is mostly confused with software development. Coding is writing programs in a language that is comprehensible to a computer. In fact, coding is usually a small part of software development. Although, very little quantitative research has occurred, a few studies have shown that less than one-fifth of the programming time is spent in coding: the rest is spent is program designing, tests and other stages of software development. Software development can be divided into several stages.

  1. Problem Definition
  2. Program Design
  3. Coding
  4. Debugging
  5. Testing
  6. Documentation
  7. Maintenance
  8. Extension and Redesign

Algorithms: The term algorithm may be formally defined as a sequence of instruction designed in such a way that if the instructions are executed in the specified sequence, the desired results will be obtained. The instructions should be precise and unambiguous and the result should be obtained after a finite number of executional steps. The latter condition actually states that an algorithm must terminate and should not repeat one or more instructions infinitely. In other words, the algorithms represent the logic of the processing to be performed. However, in order to qualify as an algorithm, a sequence of instructions must posses the following characteristics:

1.     Each and every instruction should be precise and unambiguous.

2.     Each instruction should be such that it can be performed in a finite time.

3.     One or more instructions should not be repeated infinitely. This ensures that the algorithm will ultimately terminate.

4.     After performing the instructions, that is after the algorithm terminates, the desired results must be obtained.

For Example –> There are 50 students in a class who appeared in their final examination their mark sheets have been given to you. Write an algorithm to calculate and print the total number of students who passed in first division.

Algorithm:

            Step 1:Initialize TOTAL FIRST DIVISION and TOTAL MARK SHEETS CHECKED to zero.

            Step 2: Take the mark sheet of the next student.

            Step 3: Check the division column of the mark sheet to see if it is I: if no, go to step 5.

            Step 4: Add 1 to TOTAL FIRST DIVISION.

            Step 5: Add 1 to TOTAL MARKSHEETS CHECKED.

            Step 6: Is TOTAL MARKSHEETS CHECKED=50: if no, go to step 2.

            Step 7: Print TOTAL FIRST DIVISION.

            Step 8: Stop

 

It must be clear to the reader’s form this example that even for very simple problems, the development of algorithms is not so simple as it might initially appear and requires some thinking. It may also be noted form the given example that in order to solve a given, each and every instructions must be strictly carried out in a particular sequence. It is this fact, which a beginner to problem solving by computers finds difficult to appreciate.

            There are various ways in which an algorithm can be expressed. When an algorithm is expressed in a programming language, it becomes a program. Thus, any program is an algorithm although the reverse is not true. Besides represented as programs, algorithms are often expressed in the form of flowcharts.

 

Flow Charts: The development of programs involves a series of steps which are known as program development process cycle. Students, as well as professional programmers or designers, sometimes jump immediately into coding before performing through problem analysis. The programs that result from this haste often contain clerical and logic errors. Debugging, to eliminate these errors, can cost considerable programming and machine time. And, in the process of debugging, the programmer inevitably has to analyze the problem in order to discover what went wrong. The following steps come under problem analysis:

  1. Define the problem
  2. Define all variables and reduce them to quantitative terms
  3. Reduce the problem to specifies
  4. Establish relationships

After the programmer has analyzed and defined a problem, its solution must be planned. A sequence of steps that will input and manipulate the data and produce the desired output is designed. This series of steps is the algorithm. An algorithm must express the steps in the solution in a way that will be suitable for computer processing.

            Flowcharts have become more and more specialized as the areas using them became better defined. A form of charting we all recognize is the diagram of electrical circuits. In the same way, the data processing industry has developed its own set of special symbols for use in picturing the activities in the processing of data. The first flowchart is attributed to John Von Neumann in 1945. A flowchart is simply a method of assisting the programmer to lay out in visual, two-dimensional format, the ideas as to how to organize the sequence of steps or events necessary to solve a problem with a computer. In other words, flowcharts are symbolic diagrams of operating sequence, data flow, control flow and processing logic in information processing. The charts are read in the same manner that we learned to read a page, from the upper left-hand corner of a page, left to right and top to bottom. The symbols used are simple and easy to learn. Flowcharts have many purposes. They:

  1. Provide Communication
  2. Provide an overview
  3. Aid in algorithm development and experimentation
  4. Check program logic
  5. Facilitate coding
  6. Provide program revision
  7. Provide program documentation

 

Symbols: Flowcharts are composed of symbols of different sizes and shapes. These symbols have specific meaning and functions in a flowchart. The American National Standard Institute(Groups) the symbols into three categories: basic symbols, specialized symbols, and additional symbols. Flowcharts may be drawn using only the basic and additional symbols. Flowcharts may be drawn using only tha basic and additional symbols. The specialized symbols are more precise and specific versions of basic symbols. They give more information since they describe functions in more exact detail than do basic symbols.

Basic Symbols

 

 

 


1.     Input/ Output Symbol: A parallelogram is used to represent an input or output operation. It shows the points in a program where data is made available to a system or where it is output. For example, Read number, Read file on magnetic tape, Print report.

 

 

 

 

 

2.     Process Symbol: A rectangle indicates that a change in the form or value of data will occur, or that an operating or process is to be performed. The process symbol is used to show mathematical calculations, moving data from one location to another, table look-ups and logic operations. For example, Calculate sales tax, find square root, compare two values, copy data from record to another location.

 

 

Flow-line: A Straight line between two boxes shows the path of logic flow in a program. It shows the order in which operations are performed and therefore, indicates the points at which different data has been calculated or processed. An arrowhead on the line shows the directions of flow. Unless indicated otherwise, it is assumed that data flows from top to bottom, and from left to right.

 

 

                                        Annotation, Comment Symbol: An open-ended box connected to the chart by a          

Broken line is used for descriptive comments, annotation, remarks or    explanatory notes related to the flowchart.

 

 

 

 


Decision Symbol: A diamond shows that a conditional branch has been reached. It indicates that this is a decision point in the program flow and that the program is to select one of several pathways, depending on the condition specified.  

 

 

 

Rules for making Flow Chart: Before beginning with the description of the flowchart symbols and exercises, there are some basic rules that must be kept in mind:

  1. Use the symbols as they are designed to be used
  2. Be consistent in the use of symbols
  3. Be sure that your meaning is clear, both in the way you draw the flowchart and in the entries you make within the symbols
  4. Enter and leave the symbols in the same manner
  5. Use the annotation symbol when beginning a procedure
  6. Recognize the three levels of symbols

a.      Basic symbols are used throughout the charting conventions

b.     Specialized input/output symbols are most often used in system flowcharts

c.      Specialized process symbols are most often used in program flowcharts.

Types of Flowchart: The systems designer and programmer often uses three different types of flowcharts in developing algorithms. They are:

a.      System flowcharts

b.     Modular Program flowcharts

c.      Detail program flowcharts or application flowcharts

System Flowchart: System flowcharts play a vital role in system analysis. They illustrate graphically the elements and characteristics of a system and express its structure and relationship in terms of flowchart symbols. This chart describes the sequence of major processing operations, both manual and computer, data flow and the files to be used in processing and the flow of processing control. System flowcharts are used by system analysts for analyzing or designing systems. During the problem recognition stage they illustrate data flow and relationships in the existing system. During the system design stage, they allow the analyst to conveniently with alternate data flow plans. They provide graphic records to serve as guides during implementation of a modified or newly designed business system.

            During the evaluation stage of system analysis, system flowcharts reflect the changes and alternations made. They again provide an opportunity for testing alternatives and possible variations. The implemented, working system will be documented in a system flowchart that is carefully drawn, accurate and comprehensive.

Modular Program Flowchart: Modular program flowcharts are designed primarily to illustrate algorithms for developing and writing a specific computer program. In structured or modular programs, the sequence of instructions that performs each procedure or operation is written as an independent unit or module. This module is capable of performing that procedure in other programs as well. Specific details on how a given operation is to be done are not included. Only the relationship and sequence of processes are illustrated. This type of flowchart, sometimes referred to as block diagrams, is advantages because it allows the programmer to concentrate on designing the major flow of logic in the program and temporarily ignore the computer level details. One may experiment with alternate algorithms without a great expenditure of time or effort. Modular flowcharts are excellent for communicating the major thread of logic followed in a program

            This flowchart differs from the systems flowchart in that the systems flowchart indicates the hardware, identifies the files, and shows the general flow of data; whereas the modular program flowchart defines the logical steps involved in the input, output and processing of information.

Detail Program Flowchart: Detail program flowcharts are the most comprehensive and element charts used by the programmers. Each symbol represents an executable step suitable for coding as an instruction in a computer language. The detailed steps shown in a detail program flowchart may very slightly when coding in different languages. This is because each language may perform an operation in a slightly different manner or at a different level of sophistication. The major steps in the program logic followed will usually be the same for all languages. In the detail program flowchart, each detail, minute step, or operation is shown in its correct sequence, reduced to its simplest components.

Advantage:

  1. Clarify the program logic
  2. Before coding begins, the flowchart assists the programmer in determining the type of logic control to be used in a program
  3. Serve as documentation
  4. Serve as a guide for program coding or program writing
  5. The flowchart is a pictorial representation that may be useful to the business person or user who wishes to examine some facet of the logic used in the program
  6. Ensure that all the possible conditions are accounted for
  7. Help to detect deficiencies in the problem statement

 Disadvantage:

  1. Program flowcharts are cumbersome for the programmer to write. As a result, many programmers do not write the chart until after the program has been completed, which, of course, defeats one of its main purposes
  2. It is sometimes difficult for a business person or user to understand the logic depicted in a flowchart
  3. Flowcharts are no longer completely standardized tools. The newer structured programming techniques have necessitated changes in the traditional format of a flowchart.

Techniques of Problem Solving-Programming Techniques:

Top Down: The top down approach towards program design starts with the specification of the function to be performed by a program and then breaks  it down into progressively subsidiary functions. The division of the function progresses with increasing levels of details. Each function at each level is ultimately realized in the form of a module.  In this approach, the calling module is always designed before the called module. At the time of designing a module, the broad functions to be performed by its immediate subordinate modules are assumed. The details of how a subordinate module can perform the specified functions are not considered until the subordinate module is taken up for design. Thus, the top-down approaches represents  a successive refinement of functions and this process of refinement is continued until the lowest modules can be designed without further analysis.

 

The top-down structure can be viewed as a tree structure as shown in figure.

 

 

 

 

 

 

 

 

 

 

 

 

 


Each box in this figure is a module. The topmost module denoted by 1 represents the program which can be called the main-line module or main-control module. In this case, the main-control module is divided into three subordinate modules denoted by 2, 3 and 4. The modules 2 and 4 require further divisions and in this process, the terminal modules are 5, 6, 7 and 8. The functions of these terminal modules are assumed to be simple enough to be easily programmed in the source language.                                                                                                                                                                                                     

Bottom Up: The bottom up approach is the reverse of the top-down one. The process starts with identification of a set of module which are either available or to be constructed. An attempt is made to combine the lower level modules to form modules of a high level. This process of combining modules is continued until the program is realized. The basic drawback of the bottom-up approach is the assumption that the lowest level modules can be completely specified beforehand, which in reality is seldom possible. Thus, in the bottom-up approach, quite often it is found that the final program obtained by combining the predetermined lowest level modules does not meet all the requirements of the desired program.

            No attempt is made here to compare the advantages and disadvantages of the two approaches. However, program development through top-down approach is widely accepted to be better than the bottom-up approach. The top-down approach has the following advantages:

  1. It imitates the human tendency to solve a problem by outlining the broad concepts first and then subsequently going into the details.
  2. The details of a module can be worked out with no change of the previously outlined concepts regarding its functions.
  3. The programmer never loses sight of the assumptions made at the previous levels. The development of module can take place in parallel.

These advantage suggests that if the top-down approach is taken for program design, the programs can be developed easily and quickly, committing a minimum of errors.

Modular: Modular programming is a programming strategy where a program is divided into a number of identifiable partitions or modules. Thus, a module in itself is a proper program structure. It has one entry and one exit, reads naturally from top to bottom, and may consist of any of the three basic program structures(SEQUENCE, IFTHEN ELSE, DOWHILE). The module is referenced by a name which should be as descriptive as possible. In COBOL that name is a paragraph or section name. A module should not exceed one page in length so that it is easily read. Finally, each module is executed by reference to it from another part of the program, usually through the PERFORM verb.

            The advantage of modular programming depends on how effectively the modules are designed. Each module must be designed to accomplish a distinct function. This gives the program a rather high modification potential. For example, in a pay-roll program there may be a module that calculates the dearness allowance from the basic pay using certain rules. If these rules get changed at a later date, the modification will be limited to the said module and/or to its subordinate modules, if any. It has been seen that it is easier to replace a module by a modified one than to make corrections in one particular part of a conventional program without upsetting the function of the other parts.

            Begin Main Program Module Instruction 1

            .

            .

            .

            Instruction M

            PERFORM Module A

            PERFORM Module B

            .

            .

            .

            Instruction N

            End Main Program Module

            Begin Module A

            Instruction 1

            PERFORM Module X

            Instruction 2

            .

            .

            .

            Instruction N

            End Module A

            Begin Module B

            Instruction 1

            .

            .

            .

            .

            Instruction N

            End Module B

            Begin Module X

            Instruction 1

            .

            .

            .

            Instruction N

            End Module X

Structured: A method in which programs are written according to specifically defined forms; that is, only certain kinds of program logic are allowed, although the forms involved may be nested within one another to handle complex situations. Structured programming often refers to methods in which sections of a program always have a single entry and a single exit. Thus, this step consists of preparing documents that will guide the actual coding of the program. Programmers can also prepare a structural chart that shows the hierarchical relationship between program modules. Pseudo code can be used to explain in more detail what each module does.

            Structured programming offers a number of benefits to its users. In this programming, each step is independent of the other steps, hence, allowing separate checks at each step. Each step may be verified by checking the elaboration stage by stage and an error may, therefore, be detected in a systematic manner. At any one time, only a small amount of information has to be remembered and manipulated and the structure evolved is suitable for a rigorous proof of the correctness of the entire algorithm.

            The software designer can, of course, use a combination of techniques. Flowcharting, top-down   design, structured programming and modular programming are not mutually exclusive. The tools used in this step are unimportant. The designer should remember that the real task is to produce a working program, not to follow the tenets of any particular design method. The important aspect is to plan the flow of the program, with a tool that is less rigid than a program language. This allows changes to be made in a more time-efficient manner. This step is considered complete when a clean compile walkthrough has been held and the program design has been approved.

Programming Logic

 Simple: A computer program is a series of instructions to the computer. The computer understands a language known as the machine language. The compiler translates instructions written in any high level language into the machine language. Such a translated version is known as the object module of a source program. The source program can be written in any language, such as FORTRAN, COBOL, BASIC, or C, and can be compiled by the appropriate compiler to produce the object module. A source program in a language consists of a series of instructions, known as statements. They are written such that they obey certain rules, known as the grammar of the language.

Branching: A computer program consists of a series of instructions which are executed by the compiler one by one in a sequential manner. However, sometimes the command to be executed by the compiler, depends upon some data or some intermediate result produced during the program execution. For example, imagine a shop keeper giving a discount of 10% to it’s customer who purchase goods worth Rs 500 or more. The net amount payable by the customer is determined by subtracting the discount from the purchase price. Such as evaluation is done within a computer program in the following manner.

Step 1.             Read the purchase price

Step 2.             If the purchase price>500 go to step 4 else go to step 3

Step 3.             Discount= 0 go to step 5

Step 4.             Discount= 10% of purchase price

Step 5.             Net amount payable= purchase price-discount

Step 6.             Display the net amount

Here discount cannot be evaluated by following a series of instructions in a sequential manner. The command to be executed by the complier depends upon whether the purchase price is more than 500. If it is, discount is set to 10% of the purchase price and it is otherwise set to 0. Such a situation in programming is known as branching. The compiler comes to a decision point where the decision is taken regarding the next statement to be executed. The situation is better explained with the help of what is known as a flow diagram.  

Looping: In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number. If it hasn't, the next instruction in the sequence is an instruction to return to the first instruction in the sequence and repeat the sequence. If the condition has been reached, the next instruction "falls through" to the next sequential instruction or branches outside the loop. A loop is a fundamental programming idea that is commonly used in writing programs.

          In other words, a loop is used to execute a group of instruction or a block of code multiple times, without writing it repeatedly. The block of code is executed based on a certain condition. Loops are the control structure of a program. Using loops in computer programs simplifies rather optimizes the process of coding.

          The structure of a loop can be virtually divided into two parts, namely the control statement, and the body. The control statement of a loop comprises the conditions that have to be met for the execution of the body of the loop. For every iteration of the loop, the condition in the control statement have to be true. The body of a loop comprises the block of code or the sequence of logical statements that are to be executed multiple times. When a loop in written within another loop, the control structure is termed as a nested loop. Therefore when you use a loop in program, you will not have to write the block of code, over and over again in it. The block of code will be executed as many times as the control statement will hold true and the loop will be terminated when the condition in the control statement become false. If the condition are not clearly defined in the control statement, the loop will keep on executing. Such loops are termed as infinite loops. If no terminate condition is provided in the control statement of a loop, then it automatically becomes an infinite loop.

          There are basically two types of loop in most computer programming languages, namely, entry controlled loops and exit controlled loops.

Entry Controlled Loops:- In an entry controlled loops, the control statement is written right at the beginning of the loop. This type of loop is also called a pre-checking loop. The conditions in the control statements are checked at first, and only if the conditions are true, the body of the loop is executed. If the condition turns out to be false, the lines of code in the body of the loop will not be executed.

Exit Controlled Loops:- in an exit controlled loop, that is, the control statement is written at the end of the loop structure. The lines of codes in the body of the loop are executed once before the condition is checked. Hence, this type of loop is also called a post checking loop.

          FOR loop is an entry controlled loop, that is, the control statements are written at the beginning of the loop structure, whereas, Do-While loop is an exit controlled loop, that is, the control statement are written at the end of the loop structure.

Recursion: Recursion is the process of repeating items in a self-similar way. For instance, when the surfaces of two mirrors are exactly parallel with each other, the nested images that occur are a form of infinite recursion. The term has a variety of meanings specific to a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics and computer science, in which it refers to a method of defining functions in which the function being defined is applied within its own definition. Specifically, this defines an infinite number of instances (function values), using a finite expression that for some instances may refer to other instances, but in such a way that no loop or infinite chain of references can occur. The term is also used more generally to describe a process of repeating objects in a self-similar way.

Recursion is the process a procedure goes through when one of the steps of the procedure involves invoking the procedure itself. A procedure that goes through recursion is said to be 'recursive'.

To understand recursion, one must recognize the distinction between a procedure and the running of a procedure. A procedure is a set of steps based on a set of rules. The running of a procedure involves actually following the rules and performing the steps. An analogy: a procedure is like a written recipe; running a procedure is like actually preparing the meal.

Recursion is related to, but not the same as, a reference within the specification of a procedure to the execution of some other procedure. For instance, a recipe might refer to cooking vegetables, which is another procedure that in turn requires heating water, and so forth. However, a recursive procedure is where (at least) one of its steps calls for a new instance of the very same procedure, like a sourdough recipe calling for some dough left over from the last time the same recipe was made. This of course immediately creates the possibility of an endless loop; recursion can only be properly used in a definition if the step in question is skipped in certain cases so that the procedure can complete, like a sourdough recipe that also tells you how to get some starter dough in case you've never made it before. Even if properly defined, a recursive procedure is not easy for humans to perform, as it requires distinguishing the new from the old (partially executed) invocation of the procedure; this requires some administration of how far various simultaneous instances of the procedures have progressed. For this reason recursive definitions are very rare in everyday situations. An example could be the following procedure to find a way through a maze. Proceed forward until reaching either an exit or a branching point (a dead end is considered a branching point with 0 branches). If the point reached is an exit, terminate. Otherwise try each branch in turn, using the procedure recursively; if every trial fails by reaching only dead ends, return on the path that led to this branching point and report failure. Whether this actually defines a terminating procedure depends on the nature of the maze: it must not allow loops. In any case, executing the procedure requires carefully recording all currently explored branching points, and which of their branches have already been exhaustively tried.

 

Cohesion & Coupling:

In computer programming, cohesion refers to the degree to which the elements of a module belong together. Thus, it is a measure of how strongly related each piece of functionality expressed by the source code of a software module is.

Cohesion is an ordinal type of measurement and is usually described as “high cohesion” or “low cohesion”. Modules with high cohesion tend to be preferable because high cohesion is associated with several desirable traits of software including robustness, reliability, reusability, and understandability whereas low cohesion is associated with undesirable traits such as being difficult to maintain, difficult to test, difficult to reuse, and even difficult to understand.[citation needed]

Cohesion is often contrasted with coupling, a different concept. High cohesion often correlates with loose coupling, and vice versa.[citation needed] The software quality metrics of coupling and cohesion were invented by Larry Constantine in the late 1960s as part of Structured Design, based on characteristics of “good” programming practices that reduced maintenance and modification costs. Structured Design, including cohesion and coupling

In software engineering, coupling or dependency is the degree to which each program module relies on each one of the other modules.

Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa. Low coupling is often a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability

Testing: This stage is the validation of the program. Testing ensures that the program performs correctly the required tasks. Program testing and program debugging are closely related. Testing is essentially a later stage of debugging in which the program is validated by trying it on a suitable set of test cases. Some of the test cases will certainly be the ones used in debugging – the all-zeros case, the various special cases, and other obvious cases that must be checked. However, program testing is more than a simple matter of exercising the program a few times. Exhaustive testing of all possible cases is the best alternative, but this process is usually impractical. Formal validation methods exist, but are only applicable to very simple programs. Thus, program testing requires a choice of test cases. The situation is further complicated by the fact that many microcomputer programs depend on realtime inputs that are difficult to control or simulate; the microprocessor must interact in a precise manner with a large and complex system. Several tools are available to help with this task. Among the rules that can ais in program testing are the following:

  1. Make the test plan part of the program design—testing should be one of the factors in the problem definition, program design and coding stages.
  2. Check all trivial and special cases—Often the simplest can lead to the most annoying and mysterious errors.
  3. Select test data on a random basis—Doing so will eliminate any inadvertent bias caused by the programmer selecting test data. Random number tables are widely available, and most computers have random number generators.
  4. Plan and document software testing just like hardware testing—Obviously testing can never prove that no errors exist; therefore, good software design, like good hardware design, is an essential part of the testing process.
  5. Use the maximum and minimum values of all variables as test data—Extreme values are often the source of special errors.
  6. Use statistical methods in planning and evaluating complex tasks—Methods are available for selecting data and evaluating the significance of results. Optimization of techniques may suggest good choices for system parameters and efficient sets of test data.

 Debugging: This stage is the discovery and correction of programming errors. Few programs run correctly the first time, so debugging is an important and time-consuming stage of software development. Programming theorists often refer to program debugging and testing as verification and validation respectively. Verification ensures that the program does what the programmer intends to do. Validation ensures that the program produces the correct results for a set of test data. There is no clear demarcation line between these stages. The debugging of microprocessor programs is generally quite difficult because of the inability to observe register contents directly, the primitive debugging aids, the close interaction between hardware and software, the frequent dependence of programs on precise timing, and the difficulty of obtaining adequate data for real-time applications. The tools that can be used to debug programs with brief descriptions are given below.

  1. Simulators: A simulator is a computer program that simulates the execution of programs on another computer.
  2. Logic analyzers: A logic analyzer is a test instrument that is the digital bus-oriented version of the oscilloscope. It detects the states of digital signals during each clock cycle and stores them in the memory. It then displays the information on a CRT, much as an oscilloscope does.
  3. Breakpoints: A breakpoint is a place in a program at which execution can be halted, in order to examine the current contents of registers, memory locations and I/O ports.
  4. Trace routines: A trace is a program that prints information concerning the status of the processor at specified intervals. Most simulator programs and some microcomputer development systems have trace facilities.
  5. Memory dumps: A memory dumps is a listing of the current contents of a section of the memory. Most simulator programs, microcomputer development systems and monitors can produce memory dumps.
  6. Software interrupts: The software interrupt or trap instruction is frequently used for debugging purposes. The instruction usually saves the current value of the program counter and then branches to a specified memory location. That memory location can be the starting point of a debugging program that lists or displays status information-breakpoint may be inserted with trap instructions.

No comments:

Post a Comment