Data Declarations


The format for data declarations is as follows:
     name:     storage_type     value(s)
which creates storage for variable of specified type with given name and specified value:
   var1:    .word    3
which creates a single integer variable with initial value 3.
   array1:  .byte    'a', 'b'
which creates a 2-element character array with initial values ‘a’ and ‘b’.
   array2:  .space   40
which allocates 40 consecutive bytes with storage uninitialized. It could be used as a 40-element character array, or a 10-element integer array, etc.

Review: MIPS Identifiers
    Which MIPS identifier is INVALID?

      $var
      1var
      var.1
      var_1
Result:        




      I can’t drive, I had one too many (drink too much alcohol).