Lecture 10 - Programing Structures

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

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

View Full Document Right Arrow Icon
ECE 265 LECTURE 10 PROGRAMMING STRUCTURES 11/5/2010 1 ECE265
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
Joanne E. DeGroat, OSU IF THEN ELSE structure General Form of the structure HLL pseudocode IF <expression> THEN
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online