next up previous contents
Next: Assignment 2: String Comparison Up: Contents Previous: Caution   Contents


Homework Assignment (Assigned on 10/21, due in a week)

Write a program to reverse a sequence of bytes. Start with the following code:

.dseg
original: .byte 10
reversed: .byte 10
.cseg

Put a byte sequence (anything) into original, and reversed should have the reversed sequence after your code is completed. For example, if original has the sequence:

01 23 45 67 89 ab cd ef 02 13

reversed should have the following sequence:

13 02 ef cd ab 89 67 45 23 01

Study the program at http://www.drtak.org/teaches/ARC/cisp317/samples/ld_st_example.asm. Use it as a starting point.

You have to use either the sbiw instruction or to use the predecrement mode

Send the program to tauyeung@drtak.org. The subject of your email should be ``CISP317 Project 2 by your name''.


Tak Auyeung 2003-11-10