XXIIVV

Using and defining data structures in Uxntal.

Enums are labels with unique values that can be used as constants in a program, they begin by rolling back the program address with |00:

( definition )
|00 @Suit &clubs $1 &diamonds $1 &hearts $1 &spades

( usage )
[ LIT2 -Suit/clubs -suit ] LDZ EQU

Structs define padded labels, for example the ;person/age label holds a value of 2, using that offset allows to access specific members of a data structure by applying the sublabels to a pointer:

( definition )
|00 @Person &name $2 &age $1 &height $2
@members
	=dict/melanye 2a 008c
	=dict/alexane 2c 009a

( usage )
;members ;Person/height ADD2 LDA2

Constants are labels that hold a specific value through the entire execution of the program. They allow to create label that can be used in place of a number, making the code more readable.

( definition )
|1400 @limit

( usage )
.count LDZ2 ;limit LTH2

Pro Tip: Labels can also be used with the padding runes to define a global length. For example, if you one needs to specify a length of 0x30 for multiple members of a struct, a value can be specified as follow:

|30 @length
|00 @struct &field $length

incoming uxntal syntax