RGBASM-OLD(5)
π NAME π
rgbasm-old β obsolete language documentation π
π DESCRIPTION π
Okay bestie, this is the lore drop: itβs 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 whole goal is to be a reference for backwards incompatibility when youβre upgrading an old assembly codebase to work with the latest RGBDS release. It does not attempt to list every syntax bug that was ever fixed (with some notable exceptions), nor new reserved keywords that may conflict with old identifiers. No cap. β¨
ποΈ REMOVED ποΈ
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. π
π« Automatic LD to LDH conversion (rgbasm -l)
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). Slay. π
π« Automatic NOP after HALT (rgbasm -H)
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). π«Ά
π§© Nested macro definitions
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
βͺ Negative DS
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. π
ποΈ Section-local charmaps
Deprecated in 0.3.9, removed in 0.4.0.
Defining a CHARMAP inside a SECTION when the current global charmap was the main one used to only define that character mapping within that SECTION.
Instead, use PUSHC and POPC and switch to a different character mapping for that section. π
π __FILE__ and __LINE__
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.
π₯§ _PI
Deprecated in 0.5.0, removed in 0.6.0.
Instead, use 3.141592653. Iconic. β¨
π
__DATE__ and __TIME__
Deprecated in 1.0.0.
Instead, use __ISO_8601_LOCAL__.
π’ Treating multi-character strings as numbers
Deprecated in 0.9.0, removed in 1.0.0.
Instead, use a multi-value CHARMAP, or explicitly combine the values of individual characters.
For example, instead of a multi-character string like:
CHARMAP "X", $12
CHARMAP "Y", $34
LD BC, "XY"
Either use a multi-value CHARMAP:
CHARMAP "X", $12
CHARMAP "Y", $34
CHARMAP "<XY>", 'X', 'Y'
LD BC, CHARVAL("<XY>", 0) << 8 | CHARVAL("<XY>", 1)
Or combine the individual characters:
CHARMAP "X", $12
CHARMAP "Y", $34
LD BC, 'X' << 8 | 'Y'
Or use a single-value character:
CHARMAP "X", $12
CHARMAP "Y", $34
CHARMAP "<XY>", 'X' << 8 | 'Y'
LD BC, '<XY>'
π€ Treating strings as numbers
Deprecated in 1.0.0.
Instead, use character constants or the CHARVAL function.
For example, instead of a string literal like LD A, "R", use a numeric character literal LD A, 'R'.
And instead of a string expression like CP STRUPR("\1"), use a numeric CHARVAL expression CP CHARVAL(STRUPR("\1")). π¦
π¨ rgbgfx -f/--fix and -F/--fix-and-save
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.
π¨ rgbgfx -D/--debug
Removed in 0.6.0.
β»οΈ REPLACED β»οΈ
These are features whose syntax has been changed without affecting functionality. They can generally be updated with a single search-and-replace. π
π·οΈ Defining constants and variables without DEF
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:EQUSexpansion does not occur for the symbol name, so you have to use explicit{interpolation}.
π·οΈ Defining macros like labels
Deprecated in 0.6.0, removed in 0.7.0.
Macros used to be defined as name: MACRO.
Instead, use MACRO name.
π«Ά Note:EQUSexpansion does not occur for the macro name, so you have to use explicit{interpolation}.
π·οΈ Defining variables with SET
Deprecated in 0.5.2, removed in 0.6.0.
Variables used to be defined as name SET value.
Instead, use DEF name = value.
π·οΈ Global labels without colons
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::. π
πͺ '\,' in strings within macro arguments
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.
π¬ '*' comments
Deprecated in 0.4.1, removed in 0.5.0.
These comments had to have the * typed in column 1.
Instead, use ; comments.
π STRIN, STRRIN, STRSUB, and CHARSUB
Deprecated in 1.0.0.
These functions used 1-based indexing of string characters, which was inconsistent with the 0-based indexing used more often in programming.
Instead of STRIN, use STRFIND; instead of STRRIN, use STRRFIND; instead of STRSUB, use STRSLICE; and instead of CHARSUB, use STRCHAR.
π«Ά Note: STRSLICE takes a start and end index instead of a start index and a length.
π¨οΈ PRINTT, PRINTI, PRINTV, and PRINTF
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.
π IMPORT and XREF
Removed in 0.4.0.
Symbols are now automatically resolved if they were exported from elsewhere.
Instead, just remove these directives.
π GLOBAL and XDEF
Deprecated in 0.4.2, removed in 0.5.0.
Instead, use EXPORT.
π HOME, CODE, DATA, and BSS
Deprecated in 0.3.0, removed in 0.4.0.
Instead of HOME, use ROM0; instead of CODE and DATA, use ROMX; and instead of BSS, use WRAM0.
πΉοΈ JP [HL]
Deprecated in 0.3.0, removed in 0.4.0.
Instead, use JP HL.
πΉοΈ LDI A, HL and LDD A, 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-]). π₯
πΉοΈ LDIO
Deprecated in 0.9.0, removed in 1.0.0.
Instead, use LDH.
πΉοΈ LD [C], A and LD A, [C]
Deprecated in 0.9.0, removed in 1.0.0.
Instead, use LDH [C], A and LDH A, [C].
π«Ά Note:LD [$FF00+C], AandLD A, [$FF00+C]were also deprecated in 0.9.0, but were undeprecated in 0.9.1.
πΉοΈ LDH [n8], A and LDH A, [n8]
Deprecated in 0.9.0, removed in 1.0.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].
πΉοΈ LD HL, [SP + e8]
Deprecated in 0.3.0, removed in 0.4.0.
Instead, use LD HL, SP + e8.
πΉοΈ LDHL SP, e8
Supported in ASMotor, removed in RGBDS.
Instead, use LD HL, SP + e8.
βοΈ OPT z
Deprecated in 0.4.0, removed in 0.5.0.
Instead, use OPT p.
βοΈ rgbasm -i
Deprecated in 0.6.0, removed in 0.8.0.
Instead, use -I or --include.
βοΈ rgbfix -O/--overwrite
Deprecated in 1.0.0.
Instead, use -Wno-overwrite.
βοΈ rgbgfx -h/--horizontal
Removed in 0.6.0.
Instead, use -Z or --columns.
βοΈ rgbgfx --output-*
Deprecated in 0.7.0, removed in 0.8.0.
Instead, use --auto-*.
π₯ CHANGED π₯
These are breaking changes that did not alter syntax, and so could not practically be deprecated. π
π Trigonometry function units
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.00002SIN(16384.0) == 1.0, because 16384.0 binary degrees = 16384.0/65536.0 turns = 0.25Ο radians = Ο/2 radians, and sin(Ο/2)=1ASIN(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)=1SIN(16384.0) == 0.0, because 16384 turns = 16384Ο radians = 32768Ο radians, and sin(32768Ο)=0ASIN(1.0) == 0.25
β % operator behavior with negative dividend or divisor
Changed in 0.5.0.
Instead of having the same sign as the dividend (a remainder operation), % has the same sign as the divisor (a modulo operation).
For example, previously we had:
13 % 10 == 3-13 % 10 == -313 % -10 == 3-13 % -10 == -3
Instead, now we have:
13 % 10 == 3-13 % 10 == 713 % -10 == -7-13 % -10 == -3
β¨ ** operator associativity
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).
π«Ά BUGS π«Ά
Okay so these are the misfeatures that may have been possible by mistake β they do not get deprecated, just fixed. periodt. π
π Space between exported labels' colons
Fixed in 0.7.0.
Labels with two colons used to ignore a space between them; for example, Label: :.
Instead, use Label::.
π¦ Space between label and colon
Fixed in 0.9.0.
Space between a label and its colon(s) used to be ignored; for example, Label : and Label ::. Now they are treated as invocations of the Label macro with : and :: as arguments.
Instead, use Label: and Label::.
πΈ Extra underscores in integer constants
Fixed in 1.0.0.
Underscores, the optional digit separators in integer constants, used to allow more than one in sequence, or trailing without digits on either side. Now only one underscore is allowed between two digits, or between the base prefix and a digit, or between a digit and the q fixed-point precision suffix.
β ADD r16 with implicit first HL operand
Fixed in 0.5.0.
For example, ADD BC used to be treated as ADD HL, BC, and likewise for DE, HL, and SP.
Instead, use an explicit first HL operand.
π = instead of SET
Fixed in 0.4.0.
The = operator used to be an alias for the SET keyword, which included using = for the SET instruction.
Instead, just use SET for the instruction.
π SEE ALSO π
Go check out rgbasm(1), gbz80(7), rgbds(5), and rgbds(7) β bestie cross-reference slay. β¨
π§ HISTORY π§
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.
This page is from the Debian source, version RGBASM-OLD(5), dated September 22, 2026. Byeee π
π¦ where this page comes from
- arch rolling: rgbds 1.0.4-1 Β· MIT
- nixpkgs unstable: rgbds 1.0.4
- π the page's license: MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms