Atari BASIC - Description - Input/Output - Error Handling

Error Handling

I/O routines returned error codes of 128-255 (8016-FF16) via the processor's Y register and setting the carry flag of the processor. Setting the carry flag is a neat trick since the caller can immediately branch-on-carry (BCC or BCS instructions) to an error routine, a brief, quick and relocatable 6502 instruction (2 bytes, 2 cycles), without having to test Y for the (we hope) normal case where there is no error.

As with other aspects of the CIO, error codes were common across devices but could be extended for particular devices. Error handlers could thus be written quite generically, to fail gracefully, maybe put out a message, ask the user whether to retry, propagate the error, and so on.

There were no user-friendly messages for standard error codes in the OS itself. They would be interpreted by the application.

Atari BASIC (and other languages) thus had the freedom to return error codes less than 128, and these meant different things in different languages. There was nothing to stop a perverse implementer using error codes of 128 or above, but no incentive to do so.

Read more about this topic:  Atari BASIC, Description, Input/Output

Other articles related to "error handling, error, errors":

Portable Hard Drives - Technology - Error Handling
... Modern drives make extensive use of error correction codes (ECCs), particularly Reed–Solomon error correction ... extra bits, determined by mathematical formulas, for each block of data the extra bits allow many errors to be corrected invisibly ... allow higher recording densities to be employed without causing uncorrectable errors, resulting in much larger storage capacity ...
C Standard Library - Concepts, Problems, Workarounds - Error Handling
... The error handling of the functions in the C standard library is not consistent and sometimes confusing ... Most (but not all) functions raise exceptions on errors ...

Famous quotes containing the words handling and/or error:

    Many more children observe attitudes, values and ways different from or in conflict with those of their families, social networks, and institutions. Yet today’s young people are no more mature or capable of handling the increased conflicting and often stimulating information they receive than were young people of the past, who received the information and had more adult control of and advice about the information they did receive.
    James P. Comer (20th century)

    It is not to everyone’s taste that truth should be pronounced pleasant. But at least let no one believe that error becomes truth when it is pronounced unpleasant.
    Friedrich Nietzsche (1844–1900)