# Datatypes

A list of all available datatypes


# Name

A name is a sequence of characters used for e.g. variable names.
For example foo, r12, bar987! are valid names.

It is discouraged to start a name with a character other than a char from a to z.


# String

A string is a sequence of characters surrounded by quotation marks ("").
For example "This is a string"


# Number

A sequence of digits. First char can also be a - or +. Examples 2021, +1000, -975


# Boolean

Either true or false


# Branch

A branch or jumpmark starts with a name and ends with a :. Example: main:.

A code line declaring a branch must only contain the branch.

When referencing a branch leave out the :


# Register

A register is holding a value. There are by default 16 registers r0 to r15.

  • r0 to r12 user registers
  • r13 Link Register (LR)
  • r14 Comparison (CMP)
  • r15 Program Counter (PC)

The registers r14 and r15 are reserved for internal uses and should not be written to.


# Datavar

A variable declared in the .data-block. Example: a = 512, str = "foobar" or bool = true. General syntax <name> = <value>.

The value must be one of the following types: String, Number or Boolean

The name must be unique and not share its name with a Register

Loading a datavar into a register will load its memory address rather than its value.

a = 500
//...
ldr r0, a
// r0 now contains an address referencing a

# LoadedDatavar

A loaded var is a Datavar loaded using e.g. ldr.

Loading a register referencing a datavar will load the actual value of this datavar.

// r0 is the memory address of a datavar
r0 = 19581040014
//...
ldr r0, [r0]
// r0 now contains the actual datavar value.

# Comment

Comments start with // and must be on a seperate line.


# History

  • 0.1 introduced