Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part ( d ) : Write the function encode _ letter encode _ 1 etter: parameters: one byte, pushed onto the stack by the caller,
Part d: Write the function encodeletter
encodeetter:
parameters: one byte, pushed onto the stack by the caller, passbyvalue
return value:
This document began by describing a way of encoding letters as LED light patterns,
with the example of "HELLOWORLD" given. Although you're not yet ready to display the
whole message, your task for this part is to take a single uppercase letter and to
convert it into the correct pattern lights and duration
Towards the bottom of asignallingasn you will find the label PATTERNS,
followed by an uppercase alphabet one letter per line with information on
LEDduration encodings. For example, the first noncomment line below PATTERNS
is:
which is to be interpreted as follows:
This line is for the letter A;
LEDS and are off in this pattern;
LEDS and are on in this pattern;
The lighting pattern is to appear for about one second.
Right below appears this line:
db oa
which is to be interpreted as follows:
This line is for the letter ;
LEDS and are off in this pattern;
LEDS and are on in this pattern;
The lighting pattern is to appear for about onequarter of a second.
So on and so forth.
The only other entry that requires some special explanation is the very last. It appears
here as something which you may choose to check ie if you are looking for a letter,
but find the dash then something has gone wrong with the parameter value.
When testing your code, the evaluators will only use uppercase letters. However,
you cannot be sure how you yourself will accidentally test your code!
Given the letter pushed onto the stack, your function is to determine the encoding for
the letter as would be given to ledswithspeed ie a byte value and this returned
in register That is you are not to call ledswithspeed from within
encodeletter Make use the functions you have written earlier in this assignment
to complete the function, as well as other operations. For example, the value returned
in for A would be or excc; the value returned in for would
be be or
Some code is provided for you at the label testd which you may use to try out your
work after writing code for these two functions. The video described earlier in this
document shows the expected behavior of testd
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started