RGBDS syntax updates (#905)

New MACRO and DEF syntax
This commit is contained in:
vulcandth
2022-06-06 16:25:42 -05:00
committed by GitHub
parent a4d346cc8c
commit 3648afda16
179 changed files with 2546 additions and 2545 deletions

View File

@@ -79,19 +79,19 @@ hPascalCase: ; hram
PascalCase: ; rom
; Some constants are also prefixed
rBGP EQU $ff47 ; hardware register
DEF rBGP EQU $ff47 ; hardware register
; Most other constants should be upper case
UPPER_CASE EQU 1
DEF UPPER_CASE EQU 1
; Long lists of constants should be aligned
SHORT_CONSTANT EQU 1
LONGER_CONSTANT EQU 2
PRETTY_LONG_CONSTANT EQU 3
TINY EQU 4
DEF SHORT_CONSTANT EQU 1
DEF LONGER_CONSTANT EQU 2
DEF PRETTY_LONG_CONSTANT EQU 3
DEF TINY EQU 4
BUT_ONLY_RELATED_CONSTANTS EQU 5
DEF BUT_ONLY_RELATED_CONSTANTS EQU 5
```
@@ -103,12 +103,12 @@ BUT_ONLY_RELATED_CONSTANTS EQU 5
SECTION "section", ROMX
INCLUDE "filename"
INCBIN "filename"
my_macro: MACRO
MACRO my_macro
nop
ENDM
TEST EQUS "test"
DEF TEST EQUS "test"
PURGE TEST
TEST EQU 2
DEF TEST EQU 2
; data macros should be lowercase
db 1
@@ -135,7 +135,7 @@ endr
```asm
when_in_doubt_lowercase: MACRO
MACRO when_in_doubt_lowercase
; only shift if it's required or more readable
@@ -158,7 +158,7 @@ endr
ENDM
UPPER_CASE_IS_OK_SOMETIMES: MACRO
MACRO UPPER_CASE_IS_OK_SOMETIMES
; but I can't think of any examples besides ACRONYMS