E474 Posted June 8, 2019 Share Posted June 8, 2019 Hi, Does anyone know if there is a standard error code that Basic can receive higher than SpartaDos's error 184 (http://sdx.atari8.info/sdx_files/4.48/SDX448_User_Guide.pdf, page 238)? The list at https://www.atarimax.com/jindroush.atari.org/aioe.html goes up to 177. The list at https://atariwiki.org/wiki/attach/Articles/Atari_8-Bit_Error-Codes.pdf goes up to 181. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted June 9, 2019 Share Posted June 9, 2019 Wouldn't the max for an expanded error code be 255 Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 9, 2019 Share Posted June 9, 2019 (edited) Error codes have reserved ranges (sort of) - 0 = success. 1-127 = returned error from programming language. 128 = BREAK key pressed 129-137 = CIO generated codes 138-145 = SIO generated codes except 141 which is from S: for cursor out of range for mode 146 = CIO/handler - function not implemented in handler 147 = S: - insufficient memory for requested graphics mode 148-159 was initially unused, later taken up by SpartaDos codes. 160-173 used by Atari's DOS 2.x with some unused or later taken by other Doses 174-181 used by MyDos This is from a source at https://atariwiki.org/wiki/attach/Articles/Atari_8-Bit_Error-Codes.pdf so might be incomplete or in some way in error. The OS only generates codes 0 and from 128 to 147 - generally the other and unused codes over 128 are for use by device handlers, OS extensions and modifications. Edited June 9, 2019 by Rybags 1 Quote Link to comment Share on other sites More sharing options...
E474 Posted June 10, 2019 Author Share Posted June 10, 2019 Hi, OK, thanks. BASIC uses a 1 byte error code (PEEK 195), so highest possible error number would indeed be 255, but I don't think this value is used/returned by anything. I am coding a simple assembler routine callable from BASIC via a USR call. The code calls SIO, and can return an SIO error code, but I also wanted an error code for wrong number of parameters passed in the USR call, but wanted to use a number that wasn't used for anything else. Values get returned to BASIC in FR0 ($D4,$D5), but setting 195 ($C3) in the assembler code doesn't generate something that gets caught by a BASIC TRAP statement, which would have been nice. Am going to return 200 as an error code for wrong number of parameters as it is unlikely to be used by anything else. Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 11, 2019 Share Posted June 11, 2019 Any such errors encountered during a USR( call generally won't get returned or trapped by Basic. Some exceptions of course like if you went past EOF on an input file that was in use by both, or attempting to do graphics operations with the cursor out of range. The USR( returned data can be 2 bytes so 0-65535 - but it's not treated by Basic as an error code, it's just a numeric that can be assigned to a variable or otherwise used in calculations. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.