Data Pseudoinstruction

The word ".data" signifies a pseudo-instruction in assembly language. It provides a way for the user to insert specific numerical values in specific locations in the assembled code. The pseudoinstruction has the following parts:

label: .data operands comment

The word ".data" and the operands must be included, but the comment and the label are optional. The label can be used as an operand in assembly language statements to refer to the first address of the data that is being specified. The pseudoinstruction is terminated by the newline character.

The first operand must have a positive numerical value n that indicates the number of memory cells of data that are being given specific values.

This operand is followed by one of the following:

If any of the numbers are negative integers, they are stored in 2's complement form. Note that the values can any legal literal value as specified in the assembly language syntax.

For examples, consider the following pseudoinstructions:

	.data 5 0             ; fills 5 cells with 0's
	.data 5 [0,0,0,0,0]   ; fills 5 cells with 0's
	.data 5 1 [0,0,0,0,0] ; fills 5 cells with 0's
	.data 5 5 [0]         ; fills 5 cells with 0's
	.data 5 -1            ; fills 5 cells with all 1 bits (the 2's complement representation of -1)
	.data 5 [1,2,3,4,5]   ; fills 5 cells with the five values 1, 2, 3, 4, 5
	.data 6 2 [4 2 7]     ; fills 6 cells with the three values 4, 2, 7, each using two cells.