Read the information on double-byte data and indexed addressing in section 2.3 (pp 71-73, 75-77). Also, read section 5.1 and 5.4-5.7 on stacks and subroutines.
You may work with other people in the class on conceptualizing the problem; however, this homework is to be done alone. Be sure to reference in your program the people that you work with on the conceptualization of the problem.
Write a program with a subroutine that will convert a string to all upper case letters. You will need to execute this subroutine on all available constant strings (3 of them) defined in the program. It should work like this:
fcc
or fcb
to
put three character
strings in EEPROM (somewhere). Be sure to use
a fcb
to put a 0
in the byte
immediately after your strings if you are using
fcc
to define the constant string.
00
. Remember, you have defined above
the maximum length of a string. This buffer should be able
to hold the whole string. After the string has been stored
into the buffer, exit subroutine.0
, you are
done.
'a
and 'z
. If it is,
you need to convert it to upper case; fortunately, in ASCII you
can do this by adding char(A) - char(a)
to it. Any other
character can be copied directly. Again you are done when
you hit a character with a value of 0
.
00
to the new location in memory (parameter). After the buffer has been stored
into memory, exit subroutine.0
, you are
done.
You may (in fact, you probably will) find it helpful to start by writing the program in some imperative high-level language of your choice, and translate that program into assembly code. But that's not an explicit part of the assignment.
Assemble, simulate, and debug your program before submitting it through the Web Submission page. Note: You will receive no points for a program that does not assemble.
Last modified: Tue Nov 6 20:30:34 MST 2001