diff options
| -rw-r--r-- | listamsb.1 | 12 | ||||
| -rw-r--r-- | listamsb.c | 16 | ||||
| -rw-r--r-- | listamsb.rst | 12 | 
3 files changed, 35 insertions, 5 deletions
| @@ -139,6 +139,18 @@ line \fIL\fP: EOL address \fIA\fP <= previous \fIB\fP  .sp  Corrupt file, or not an AMSB file.  .IP \(bu 2 +line \fIL\fP is suspiciously long +.sp +The line is >128 bytes long, but less than 256. AMSB can execute +lines of this length, but it\(aqs impossible to actually enter them +in the editor, because a logical line can\(aqt be longer than 3 +screen lines. Possibly corrupted file. +.IP \(bu 2 +line \fIL\fP is impossibly long +.sp +The line is >= 256 bytes long. AMSB will crash, if you try to +LOAD the file. Corrupted file. +.IP \(bu 2  line \fIL\fP EOL address doesn\(aqt match actual line length \fIN\fP  .sp  Same as above: corrupt, or not AMSB. @@ -33,11 +33,13 @@     even with cart-based AMSB2 and no DOS loaded. */  #define MAX_PROGLEN 30000 -/* there should never be a valid line of BASIC longer than this many +/* there should never be a valid line of BASIC longer than MAX_LINE_LEN     bytes, since there would be no way to enter it in the editor. AMSB     uses the standard E: device, which limits you to 4 screen lines, or -   max 120 bytes. */ +   max 120 bytes. there *cannot* be a line longer than MAX_LINE_LEN_HARD, +   because AMSB would crash when you try to LOAD such a program. */  #define MAX_LINE_LEN 0x80 +#define MAX_LINE_LEN_HARD 0xff  /* a program whose header has a length less than MIN_PROGLEN can't be     a real AMSB program. EMPTY_PROGLEN is what you get if you @@ -273,9 +275,13 @@ int next_line(void) {  	}  	if(len > MAX_LINE_LEN) { -		fprintf(stderr, "%s: line %d is suspiciously long (length %d > %d)\n", -			self, lineno, len, MAX_LINE_LEN); -		warnings++; +		int hard = len > MAX_LINE_LEN_HARD; +		fprintf(stderr, "%s: line %d is %s long (length %d > %d)\n", +			self, +			lineno, +			hard ? "impossibly" : "supiciously", +			len, +			hard ? MAX_LINE_LEN : MAX_LINE_LEN_HARD);  	}  	if(last_ptr != -1) { diff --git a/listamsb.rst b/listamsb.rst index bf3863b..c5177e0 100644 --- a/listamsb.rst +++ b/listamsb.rst @@ -123,6 +123,18 @@ continues processing.    Corrupt file, or not an AMSB file. +- line *L* is suspiciously long + +  The line is >128 bytes long, but less than 256. AMSB can execute +  lines of this length, but it's impossible to actually enter them +  in the editor, because a logical line can't be longer than 3 +  screen lines. Possibly corrupted file. + +- line *L* is impossibly long + +  The line is >= 256 bytes long. AMSB will crash, if you try to +  LOAD the file. Corrupted file. +  - line *L* EOL address doesn't match actual line length *N*    Same as above: corrupt, or not AMSB. | 
