CSci250 Assembly Language Programming: Homework 2
Due date (firm): Monday, September 29, 2008 in class
Each homework may have a different weight, which depends on its level of difficulty.
Absolutely no copying others' work

  1. A program without the statement exit can still be assembled successfully. Explain what would happen when the program executes.     (15%)






  2. What is the purpose of the identifier in the END statement?     (15%)






  3. Declare a string variable containing the string “This is only a test.”, including the end-of-string symbol 0, repeated 100 times.     (15%)




  4. Show the order of individual bytes in memory (lowest to highest) for the following variables:     (20%)
         val1   DWORD  123h
         val2   BYTE   0ABh
         val3   WORD   4, 5
    lowest
    Byte 1 2 3 4 5 6 7 8 9 10 11 ...
                          ...

  5. Show how to calculate the number of elements, 200 in this example, in the following array and assign the value to a symbolic constant named arraySize:     (15%)
         myArray  DWORD  10 DUP( 10 DUP( ?, ? ) )




  6. Use TEXTEQU to create a symbol named string for a string constant of repeating the word “Hello”, without the end-of-string symbol 0, 10 times and the word “World”, without the end-of-string symbol 0, 5 times by using the DUP operator. After the declaration, use the symbol when defining a string variable named myString.     (20%)