Lecture 10 - Programing Structures

# Lecture 10 - Programing Structures - ECE265 ECE 265 LECTURE...

This preview shows pages 1–8. Sign up to view the full content.

ECE 265 LECTURE 10 PROGRAMMING STRUCTURES 11/5/2010 1 ECE265

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Joanne E. DeGroat, OSU Lecture Overview Programming structures Translation of HLL structures to assembler In line code Conditional code statement Loop control statements Control Structures Nested loops REF: Chapter 4 11/5/2010 2 ECE265
Joanne E. DeGroat, OSU Translation to Assembler Common HLL structures Straight line code – code to compute results Loop code – code to establish a repetitive loop based on a count or condition Decision code – code to direct execution flow to take one path or the other. Nested Loops 11/5/2010 ECE265 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Joanne E. DeGroat, OSU In line code These are direct blocks of code in a flow chart square box Consider the HLL equation y = a + b - c Memory locations are y \$20 a \$21 b \$22 c \$23 Coded into assembler LDAA \$21 ADDA \$22 SUBA \$23 STAA \$20 11/5/2010 ECE265 4
Joanne E. DeGroat, OSU Conditional Code Statements Very few computational tasks involve simply a unconditional sequence of tasks. In an embedded system (the real world) there is always a variability in the inputs or the data to be acted on. This gives rise to a couple of possible logical constructs IF a given condition is true THEN take a given action IF a given condition is true THEN take a given action . Otherwise (ELSE) take and alternative action 11/5/2010 ECE265 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Joanne E. DeGroat, OSU The IF THEN structure Graphical form of the structure HLL pseudocode IF <expression> THEN [process] END Generally the process is straight inline code 11/5/2010 ECE265 6
Joanne E. DeGroat, OSU IF THEN ELSE structure General Form of the structure HLL pseudocode IF <expression> THEN

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 24

Lecture 10 - Programing Structures - ECE265 ECE 265 LECTURE...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online