DAT

Designator: Declare a Data Block.

DAT
  < Symbol > Alignment < Size > < Data > < [Count ] > <, < Size > Data < [Count ] >>…


DAT
  < Symbol > < Condition > Instruction Operands < Effect(s) >

  • Symbol is an optional name for the data, reserved space, or instruction that follows.
  • Alignment is the desired alignment and default size (BYTE, WORD, or LONG) of the data elements that follow.
  • Size is the desired size (BYTE, WORD, or LONG) of the following data element immediately following it; alignment is unchanged.
  • Data is a constant expression or comma-separated list of constant expressions. Quoted strings of characters are also allowed; they are treated as a comma-separated list of characters.
  • Count is an optional expression indicating the number of byte-, word-, or long-sized entries of Data to store in the data table.
  • Condition is an assembly language condition, IF_C, IF_NC, IF_Z, etc.
  • Instruction is an assembly language instruction, ADD, SUB, MOV, etc.
  • Operands is zero, one, or two operands as required by the Instruction.
  • Effect(s) is/are one, two or three assembly language effects that cause the result of the instruction to be written or not, NR, WR, WC, or WZ.

Explanation

A DAT (Data) block is a section of source code that contains pre-defined data, memory reserved for run-time use and Propeller Assembly code. This is one of six special declarations (CON, VAR, OBJ, PUB, PRI, and DAT) that provide inherent structure to the Spin language.

Data blocks are multi-purpose sections of source code that are used for data tables, run-time workspace, and Propeller Assembly code. Assembly code and data can be intermixed, if necessary, so that data is loaded into a cog along with the assembly code.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.