Skip to main content
Version: master

rgbasm-old(5) — obsolete language documentation

This is the list of features that have been removed from the rgbasm(5) assembly language over its decades of evolution, along with their modern alternatives. Its goal is to be a reference for backwards incompatibility, when upgrading an old assembly codebase to work with the latest RGBDS release. It does attempt to list syntax bugs that were fixed, nor new reserved keywords that may conflict with old identifiers.

These are features which have been completely removed, without any direct alternatives. Usually these features were limiting the addition of other features, or had awkward limits on their own intended effects.

Deprecated in 0.7.0, removed in 0.8.0.

rgbasm(1) used to automatically treat ‘LD’ as ‘LDH’ if the address was known to be in the $FF00-$FFFF range, with the -L flag to opt out. rgbasm(1) 0.6.0 added a -l flag to opt in instead.

Instead, use ‘LDH’, and remove the -L and -l flags from rgbasm(1).

Deprecated in 0.7.0, removed in 0.8.0.

rgbasm(1) used to automatically insert a ‘NOP’ after ‘HALT’, with the -h flag to opt out. rgbasm(1) 0.6.0 added a -H flag to opt in instead.

Instead, use an explicit ‘NOP’ after ‘HALT’, and remove the -h and -H flags from rgbasm(1).

Removed in 0.4.2.

Instead, put the nested macro definition inside a quoted string (making sure that none of its lines start with ENDM), then interpolate that string. For example:

MACRO outer
    DEF definition EQUS """
        MACRO inner
            println (\1) - (\\1)
        \nENDM"""
    {definition}
    PURGE definition
ENDM
    outer 10
    inner 3 ; prints 7

Removed in 0.3.2.

This was used to "rewind" the value of @ in RAM sections, allowing labeled space allocations to overlap.

Instead, use UNION.

Deprecated in 0.6.0, removed in 0.7.0.

Instead, use WARN or FAIL to print a complete trace of filenames and line numbers.

Deprecated in 0.5.0, removed in 0.6.0.

Instead, use ‘3.141592653’.

Deprecated in 0.9.0.

Instead, use a multi-value CHARMAP, or explicitly combine the values of individual characters.

Removed in 0.6.0.

Instead, use ‘rgbgfx -c/--colors’ to explicitly specify a color palette. If using ‘-c embedded’, arrange the PNG's indexed palette in a separate graphics editor.

Removed in 0.6.0.

These are features whose syntax has been changed without affecting functionality. They can generally be updated with a single search-and-replace.

Deprecated in 0.7.0, removed in 0.8.0.

EQU, EQUS, =, RB, RW, and RL definitions used to just start with the symbol name, but had to be typed in column 1.

Instead, use DEF before constant and variable definitions. Note that EQUS expansion does not occur for the symbol name, so you have to use explicit ‘{interpolation}’.

Deprecated in 0.6.0, removed in 0.7.0.

Macros used to be defined as ‘name: MACRO’.

Instead, use ‘MACRO name’. Note that EQUS expansion does not occur for the macro name, so you have to use explicit ‘{interpolation}’.

Deprecated in 0.5.2, removed in 0.6.0.

Variables used to be defined as ‘name SET value’.

Instead, use ‘DEF name = value’.

Deprecated in 0.4.0, removed in 0.5.0.

Labels used to be definable with just a name, but had to be typed in column 1.

Instead, use explicit colons; for example, ‘Label:’ or exported ‘Label::’.

Deprecated in 0.5.0, removed in 0.7.0.

Macro arguments now handle quoted strings and parenthesized expressions as single arguments, so commas inside them are not argument separators and do not need escaping.

Instead, just use commas without backslashes.

Deprecated in 0.4.1, removed in 0.5.0.

These comments had to have the ‘*’ typed in column 1.

Instead, use ‘;’ comments.

Deprecated in 0.5.0, removed in 0.6.0.

These directives were each specific to one type of value.

Instead, use PRINT and PRINTLN, with STRFMT or ‘{interpolation}’ for type-specific formatting.

Removed in 0.4.0.

Symbols are now automatically resolved if they were exported from elsewhere.

Instead, just remove these directives.

Deprecated in 0.4.2, removed in 0.5.0.

Instead, use EXPORT.

Deprecated in 0.3.0, removed in 0.4.0.

Instead of HOME, use ROM0; instead of CODE and DATA, use ROMX; instead of BSS, use WRAM0.

Deprecated in 0.3.0, removed in 0.4.0.

Instead, use ‘JP HL’.

Deprecated in 0.3.0, removed in 0.4.0.

Instead, use ‘LDI A, [HL]’ and ‘LDD A, [HL]’ (or ‘LD A, [HLI]’ and ‘LD A, [HLD]’; or ‘LD A, [HL+]’ and ‘LD A, [HL-]’).

Deprecated in 0.9.0.

Instead, use ‘LDH’.

Deprecated in 0.9.0.

Instead, use ‘LDH [C], A’ and ‘LDH A, [C]’.

Deprecated in 0.9.0.

LDH’ used to treat "addresses" from $00 to $FF as if they were the low byte of an address from $FF00 to $FFFF.

Instead, use ‘LDH [n16], A’ and ‘LDH A, [n16]’.

Deprecated in 0.3.0, removed in 0.4.0.

Instead, use ‘LD HL, SP + e8’.

Supported in ASMotor, removed in RGBDS.

Instead, use ‘LD HL, SP + e8’.

Deprecated in 0.6.0, removed in 0.8.0.

Instead, use -I or --include.

Removed in 0.6.0.

Instead, use -Z or --columns.

Deprecated in 0.7.0, removed in 0.8.0.

Instead, use --auto-*.

These are breaking changes that did not alter syntax, and so could not practically be deprecated.

Changed in 0.6.0.

Instead of dividing a circle into 65536.0 "binary degrees", it is now divided into 1.0 "turns".

For example, previously we had:

  • SIN(0.25) == 0.00002’, because 0.25 binary degrees = 0.25/65536.0 turns = 0.000004τ radians = 0.000008π radians, and sin(0.000008π)=0.00002
  • SIN(16384.0) == 1.0’, because 16384.0 binary degrees = 16384.0/65536.0 turns = 0.25τ radians = π/2 radians, and sin(π/2)=1
  • ASIN(1.0) == 16384.0

Instead, now we have:

  • SIN(0.25) == 1.0’, because 0.25 turns = 0.25τ radians = π/2 radians, and sin(π/2)=1
  • SIN(16384.0) == 0.0’, because 16384 turns = 16384τ radians = 32768π radians, and sin(32768π)=0
  • ASIN(1.0) == 0.25

Changed in 0.9.0.

Instead of being left-associative, ‘**’ is now right-associative.

Previously we had ‘p ** q ** r == (p ** q) ** r’.

Instead, now we have ‘p ** q ** r == p ** (q ** r)’.

rgbasm(1), gbz80(7), rgbds(5), rgbds(7)

rgbasm(1) was originally written by Carsten Sørensen as part of the ASMotor package, and was later repackaged in RGBDS by Justin Lloyd. It is now maintained by a number of contributors at https://github.com/gbdev/rgbds.