ANS2 - 1. [10 % ] H igh 98 U ppe r qua rte r 85 M e dia n...

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

View Full Document Right Arrow Icon
ECE 4175 QUIZ 3-25-09 (1 of 2) High 98 SIX PROBLEMS Upper quarter 85 Open book, open notes Median 74 Lower quarter 64 Low 24 1. Show the C code for executing a function called DoThis if (and only if) bit 0 of a char RAM variable, NEW, equals bit 7 of a char RAM variable, OLD. [10%] if((OLD>>7) == (NEW & 0x01)) { DoThis(); } 2. Assume that we have a variable display string called BottomRow that when used with the DisplayV function will rewrite all 24 characters of the bottom row of the LCD. Write a C function called [35%] ScrollLeft that will modify BottomRow so that the left-most displayable character is discarded, the remaining characters are shifted left one place, and the ASCII-coded character in NEWCHAR is inserted in the right-most displayable character position. After two-thirds of a semester of writing C code, I expected (required) you to use a loop statement for moving characters within a string. Furthermore, you lost 5 points if this loop statement was not the “for” statement that identifies the specific bytes to be dealt with in its clear, identifiable way. Another thing you had to be aware of is that the 0 byte in the string represents the th cursor-position code and must be left alone. And given that we are dealing with a
Background image of page 1

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

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

Page1 / 2

ANS2 - 1. [10 % ] H igh 98 U ppe r qua rte r 85 M e dia n...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online