Skip to main content

Section A.3 Assembler Directives

Directive Description
.align n Align next datum to an address divisible by \(2^n\)
.ascii str Add ASCII string \(\mathit{str}\) to data segment
.asciiz str Add zero-terminated ASCII string to data segment
.byte b1, ..., bn Add bytes \(b_1\) to \(b_n\) successively into segment
.data Start/continue data segment
.globl sym Declare symbol \(\mathit{sym}\) as global (visible from other object files)
.half h1, ..., hn Add half words \(h_1\) to \(h_n\) to segment
.space n Reserve \(n\) bytes of free space in current segment
.text Start code segment
.word w1, ..., wn Add words \(w_1\) to \(w_n\) successively to current segment