Added assembler check for string outside Data Segment.
This commit is contained in:
@@ -24,6 +24,8 @@ Any token beginning with a '0' is read as a numerical literal, so a malformed on
|
||||
|
||||
A string may be up to 255 characters. Each one is written down with a zero byte on the end, which is what lets a program find where it stops, and it means two strings written one after the other are not one longer string: there is a zero between them. A run of bytes longer than a string can hold has to be written as literals, or put there by the program itself while it runs.
|
||||
|
||||
**Strings belong in the Data Segment, and only there.** This is a Harvard machine: no instruction reads Program Memory, so a string put in the Program Segment could not be read by the program carrying it, and only the memory controller could reach it at all. The assembler refuses one rather than emitting bytes nothing can use. Single byte literals are a different matter and may go in either segment — a table of bytes a program branches through is a reasonable thing to want in Program Memory.
|
||||
|
||||
The one exception to the single byte rule is #Align and #Reserve, whose numbers are never emitted as bytes and may go up to 0xFFFF. See Moving The Cursor Along.
|
||||
|
||||
## Labels:
|
||||
|
||||
Reference in New Issue
Block a user