LanguageUpdated 2026-07-24

The GPC data section

Store compact read-only byte data and retrieve it with the official dbyte, dchar, and dword accessors.

Overview

The data section holds static byte values at the beginning of virtual address space. Its contents cannot be changed while the script runs.

dbyte reads one unsigned byte, dchar interprets a byte as signed, and dword reads a multi-byte word from a zero-based data index.

Key facts

  • Data is declared before runtime blocks.
  • Data entries are byte-oriented and read-only at runtime.
  • Index calculations should be bounded before retrieval.

GPC syntax examples

Examples are intentionally small. Replace identifiers only with values documented for your target.

Read static byte dataexample.gpc
data (20, 42, 35, 255)

int value;

main {
    value = dbyte(3);
}

Functions, commands, and terms

Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.

NameKindPurpose
datadeclaration

Declares a parenthesized sequence of static byte values.

dbytefunction

Returns an unsigned 8-bit value from a zero-based data index.

dcharfunction

Returns a data byte interpreted as a signed 8-bit value.

dwordfunction

Returns a word assembled from data starting at the selected index.

Common mistakes

Writing to data at runtime.

Reading past the declared data.

Assuming data values behave like signed runtime variables.

Official GPC sources

Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.

Related GPC references