Difference between revisions of "CSC231 Addressing Mode Exercises"

From dftwiki3
Jump to: navigation, search
(New page: =Exercises on Addressing Modes= ==Exercise 1== Write a program that changes all the characters of an all-uppercase string to all-lowercase. We assume the string does not contain blank sp...)
 
(Exercise 1)
Line 3: Line 3:
 
==Exercise 1==
 
==Exercise 1==
 
Write a program that changes all the characters of an all-uppercase string to all-lowercase.  We assume the string does not contain blank spaces
 
Write a program that changes all the characters of an all-uppercase string to all-lowercase.  We assume the string does not contain blank spaces
 +
 +
<font color="white">
 +
<code><pre>
 +
 +
toto
 +
 +
</pre></code>
 +
</font>
  
 
==Exercise 2==
 
==Exercise 2==

Revision as of 11:19, 1 October 2008

Exercises on Addressing Modes

Exercise 1

Write a program that changes all the characters of an all-uppercase string to all-lowercase. We assume the string does not contain blank spaces


toto

Exercise 2

Write a program that fills an array of 8 bytes with the first 8 fibonacci terms

Exercise 3

Write a program that fills an array of 16 words with the first 16 fibonacci terms

Exercise 4

Write a program that fills an array of 10 double-words with the first 10 powers of 2.

Exercise 5

Assume an array of 11 words, and the first words contains a constant. Write the program that stores 1/2 the value of the constant in the 2nd word, 1/4 the value in the 3rd word, 1/8 4th word, 1/16 5th word, etc.

Exercise 6

Copy a string into another string, reversing the order of the string to see if they are palindromes.