Jump to content
IGNORED

Highest standard error code in BASIC?


Recommended Posts

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.

 

 

Link to comment
Share on other sites

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 by Rybags
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...