Intrinsic Data Types
MIPS defines various intrinsic data types, each of which describes a set of values that can be assigned to variables of the given type.
Some examples of data declarations are as follows:
.data
str: .asciiz "Hello, World!"
value1: .word 0x100
value2: .byte 'A', 'B', 'C'
finalVal: .space 32
The MIPS intrinsic data types and their definitions are given below:
Type |
Definition |
Example |
.ascii |
Assembles each string from the list into successive locations. |
value1: .ascii "xyz" |
.asciiz |
Assembles each string in the list into successive locations and adds a null.
|
Value2: .asciiz "xyz" |
.byte |
Truncates the expressions from the comma-separated list to 8-bit values, and assembles the values in successive locations.
|
_value3: .byte 0x10 |
.double |
Initializes memory to 64-bit floating point numbers.
This directive automatically aligns its data and any preceding labels to a double-word boundary.
|
$val: .double 3.14159 |
.float |
Initializes memory to single precision 32-bit floating point numbers.
This directive automatically aligns its data and preceding labels to a word
boundary.
|
_6: .float 3.1 |
.half |
Truncates the expressions in the comma-separated list to 16-bit values and assembles the values in successive locations.
This directive automatically aligns its data and preceding labels to a halfword boundary.
|
_$.7: .half 0 |
.space |
Advances the location counter by the value of the specified expression bytes.
The assembler fills the space with zeros.
|
$_: .space 64 |
.word |
Truncates the expressions in the comma-separated list to 32-bits
and assembles the values in successive locations.
This directive automatically aligns its data and preceding labels to a word
boundary.
|
_.8: .word -100, 0x80 |
“If opportunity doesn’t knock, build a door.”
― Milton Berle
|