hw1
DESCRIPTION
hw1TRANSCRIPT
Fall 2012 ECE498 Linux Assembly Language Homework 1Due: 21 November 2012, 6PM1. Download the code fromhttp://www.eece.maine.edu/vweaver/classes/ece498asm2012f/hw1code.tar.gzto an x86 Linux machine.2. Uncompress/unpack it with the command tar -xzvf hw1code.tar.gz(the options to tar stand for eXtract Zipped Verbose File)3. Change into the hw1 code directory cd hw1code4. Run make to build the code5. Run ./countto32This should only print 06. Modify the countto32.s le so it counts to 32. Place your code wherethe comments say to. Be sure to comment your code!Hint: there are many possible ways to do this. Some useful instructions areinc, add, dec, sub, cmp, jnz, jz, and if youre feeling CISCy: loop.7. Describe how the decimal printing routine in count to 32.s works. Put youranswer in the README le.8. Can the call printstring at the end of printnumber be changedto an unconditionaljmp instruction? What advantage would there be indoing this? Put your answer in the README le.9. Make a copy of your working count-to-32 codecp countto32.s countto32hex.s10. Convert the printnumber routine in countto32hex.s to insteadprint base-16 hexadecimal. Hint:man ascii can help. The nished pro-gram should count from 0 to 32 in hex.11. Run make submit which will create a hw1submit.tar.gz le. con-taining countto32.s, countto32hex.s, and README.12. You can verify the contents with tar -tzvf hw1submit.tar.gz13. e-mail the hw1submit.tar.gz le to me by the homework deadline.