mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Make ENDL optional like ENDSECTION (#1538)
Add warning for `LOAD` without `ENDL`
This commit is contained in:
21
man/rgbasm.5
21
man/rgbasm.5
@@ -903,7 +903,7 @@ SECTION "LOAD example", ROMX
|
||||
CopyCode:
|
||||
ld de, RAMCode
|
||||
ld hl, RAMLocation
|
||||
ld c, RAMLocation.end - RAMLocation
|
||||
ld c, RAMCode.end - RAMCode
|
||||
\&.loop
|
||||
ld a, [de]
|
||||
inc de
|
||||
@@ -927,8 +927,8 @@ RAMLocation:
|
||||
|
||||
\&.string
|
||||
db "Hello World!\e0"
|
||||
\&.end
|
||||
ENDL
|
||||
\&.end
|
||||
.Ed
|
||||
.Pp
|
||||
A
|
||||
@@ -938,7 +938,9 @@ block feels similar to a
|
||||
declaration because it creates a new one.
|
||||
All data and code generated within such a block is placed in the current section like usual, but all labels are created as if they were placed in this newly-created section.
|
||||
.Pp
|
||||
In the example above, all of the code and data will end up in the "LOAD example" section.
|
||||
In the example above, all of the code and data will end up in the
|
||||
.Dq LOAD example
|
||||
section.
|
||||
You will notice the
|
||||
.Sq RAMCode
|
||||
and
|
||||
@@ -950,6 +952,19 @@ You cannot nest
|
||||
.Ic LOAD
|
||||
blocks, nor can you change or stop the current section within them.
|
||||
.Pp
|
||||
The current
|
||||
.Ic LOAD
|
||||
block can be ended by using
|
||||
.Ic ENDL .
|
||||
This directive is only necessary if you want to resume writing code in its containing ROM section.
|
||||
Any of
|
||||
.Ic LOAD , SECTION , ENDSECTION ,
|
||||
or
|
||||
.Ic POPS
|
||||
will end the current
|
||||
.Ic LOAD
|
||||
block before performing its own function.
|
||||
.Pp
|
||||
.Ic LOAD
|
||||
blocks can use the
|
||||
.Ic UNION
|
||||
|
||||
Reference in New Issue
Block a user