CSC231 Homework 3 2010

From dftwiki3
Revision as of 07:59, 30 September 2010 by Thiebaut (talk | contribs) (Created page with '--~~~~ ---- <br /> <tanbox> This assignment is light, so take advantage of it! It is due on Wednesday Oct. 6, at 11:59 p.m. + 1 minute. </tanbox> <br /> =Problem #1= * Assume…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut 12:59, 30 September 2010 (UTC)



This assignment is light, so take advantage of it! It is due on Wednesday Oct. 6, at 11:59 p.m. + 1 minute.


Problem #1

  • Assume that we have an array of bytes declared as follows:
     tableb     db      1, 10, 0xff, 5, 0x0a
and that we want to transfer it into an array of words defined as follows:
     tablew    dw      0, 0, 0, 0, 0
  • write the code necessary to transfer the information from tableb to tablew, so that each byte gets stored in a word, without the value changing. In other word, when 1 is copied from the first byte of tableb t the first word of tablew, the value in that word is 1, coded in 16 bits. Similarly, when 0xff is copied from the 3rd byte of tableb to the 3rd word of tablew, the value of that word is still 0xff, but coded in 16 bits.
  • We do not know loops yet, so do not use loops.
  • Since there are 5 pieces of information to copy, use different methods to copy each piece of information.
  • Store your program in a file called hw3a.asm and submit it as follows:
   submit hw3 hw3a.asm

Problem #2

  • Exact same question as Problem #1, but the second array, tabled, is now an array of double-words.
  • Store your program in a file called hw3b.asm and submit it as follows:
   submit hw3 hw3b.asm