Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 6 Programming l Problem solving l Debugging.

Similar presentations


Presentation on theme: "Chapter 6 Programming l Problem solving l Debugging."— Presentation transcript:

1 Chapter 6 Programming l Problem solving l Debugging

2 2 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Problem solving l Start with systematic decomposition of problem –“top-down” analysis –stepwise refinement l Algorithms must have properties of: –finiteness –definiteness –computability

3 3 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Structured programming l Three control structures: –Sequential l This is the default –Conditional l Branching or decision-making –Iteration l Loops

4 4 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Implementing the control structures Sequential Conditional Iterative

5 5 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Stepwise refinement illustrated

6 6 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Stepwise refinement Stepwise refinement –Final level

7 7 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Debugging l A debugging tool provides (at least) the ability to: – Set values to registers & memory locations l enter as hex, decimal or binary values – Execute instructions one at a time, or in small groups l Run will set the program running l Step causes a fixed number of instructions to be executed (often used to “single-step” through part of a program) – Stop execution when desired l Breakpoints allow the user to set points at which execution will halt & wait for a new “Run” instruction – Examine the contents of registers and memory locations at any point

8 8 College of Charleston, School of Science and Math Dr. Anderson, Computer Science CS 250 Comp. Org. & Assembly Debugging example l A program to find the first 1 in a 16-bit word


Download ppt "Chapter 6 Programming l Problem solving l Debugging."

Similar presentations


Ads by Google