next up previous
Next: Arithmetic Instructions Up: SAL & SPIM Previous: Variable Declarations

SAL Directives

SAL directives are used to define variables and data types.

.data

What follows are data declarations.

.text

What follows are assembly language instructions.

label: .word value

A 32 bit two's complement integer initially containing value is stored at label. value is an optional field; if omitted, the location is initialized to zero.

label: .byte value

A one byte ASCII character containing value is stored at label. A character value is specified by enclosing it in single quotes. value is an optional field; if omitted the byte is initialized to null.

label: .float value

A 32 bit IEEE single precision floating point number initially containing value is stored at label. value must contain a decimal point. value is optional; if omitted, the location is initialized to zero.

label: .double value

A 64 bit IEEE double precision floating point number initially containing value is stored at label. value must contain a decimal point. value is optional; if omitted, the location is initialized to zero.

label: .space N

Allocate N bytes of space in the current segment (which must be the data segment in SPIM). The space allocated is not initialized.

label: .ascii string

A string is placed in memory beginning at label. string is an ASCII string enclosed in double quote marks (" ").

label: .asciiz string

A null-terminated string is placed in memory beginning at label. string is an ASCII string enclosed in double quote marks (" ").



CS 301 Class Account
Wed Sep 20 17:20:34 ADT 2000