CSC270 6811 Programming Exercises

From dftwiki3
Jump to: navigation, search

--D. Thiebaut 16:48, 24 March 2011 (EDT)



All exercises should be assembled by hand.

6811AssemblyExample.png





Exercise 1
Write and assemble a 6811 assembly language program that adds the contents of 2 variables in memory, a, and b, and stores the result in a third variable sum.
Exercise 2
Same as Exercise 1, but use a different method, either selecting a different addressing mode, or different instructions.
Exercise 3
Compute the first 6 Fibonacci terms, assuming that you have an array of 6 bytes, all initially containing 0.
Exercise 4
Same idea: take your solution for Exercise 3 and modify it. The result should be the same, but you have to change the way the computation is done.
Exercise 5
Write an endless loop that stores 1, 2, 3, 4, 5... in a variable in memory called count. How long is your loop, in terms of CPU cycles?
Exercise 6
Make your loop faster!
Exercise 7
Even faster!
Exercise 8
Compute the sum of all the integers between 1 and 22, using no more than 10 instructions.