These are the error codes that QDOSMSQ can return from a vectored utility, a Trap or from SuperBasic extensions.
When writing assembler routines, it is always advised to explicitly check the value in D0.L for an error code. This is done quickest using :
: trap #n ; Do the trap. tst.l d0 ; Did it work? beq.s all_ok ; Yes, all is well errors : ; Handle errors here bra kill_job ; And exit the job, or code somehow. all_ok : ; Carry on from here if all worked.
Some traps and vectored utilities do not set the Z flag before returning which is why you have to do it. Well, actually, it's not that they don't set it but when you call a trap, the status register is stacked for the duration and restored at the end, so while D0 may have an appropriate error code in it, the Z flag's state is unknown. A vector should always have correctly set the Z flag, so save some coding and execution time by simply checking the Z flag, as follows:
move.w <whatever>,a2 ; Get the vectored routine. jsr (a2) ; Do it. beq.s vec_ok ; All is well, skip error handler. v_error : ; Handle errors here bra kill_job ; And exit the job, or code somehow. vec_ok : ; Carry on from here if all worked.
Value | QDOS Mnemonic | SMS Mnemonic | Description |
---|---|---|---|
-1 | ERR_NC | ERR_NC | Operation not complete . |
-2 | ERR_NJ | ERR_IJOB | Not a (valid) job. |
-3 | ERR_OM | ERR_IMEM | Out of memory. |
-4 | ERR_OR | ERR_ORNG | Out of range. |
-5 | ERR_BO | ERR_BFFL | Buffer overflow. |
-6 | ERR_NO | ERR_ICHN | Channel not open. |
-7 | ERR_NF | ERR_FDNF | File or device not found. |
-8 | ERR_EX | ERR_FEX | File already exists. |
-9 | ERR_IU | ERR_FDIU | File or device already in use. |
-10 | ERR_EF | ERR_EOF | End of file. |
-11 | ERR_DF | ERR_DRFL | Drive full. |
-12 | ERR_BN | ERR_INAM | Bad device. |
-13 | ERR_TE | ERR_TRNS ERR_PRTY | Transmission error Parity error (SMS only). |
-14 | ERR_FF | ERR_FMTF | Format failed. |
-15 | ERR_BP | ERR_IPAR | Bad parameter. |
-16 | ERR_FE | ERR_MCHK | File error. |
-17 | ERR_EX | ERR_IEXP | Expression error. |
-18 | ERR_OV | ERR_OVFL | Arithmetic overflow. |
-19 | ERR_NI | ERR_NIMP | Not implemented. |
-20 | ERR_RO | ERR_RDO | Read only. |
-21 | ERR_BL | ERR_ISYN | Bad line of Basic. |
-22 | ERR_RWF | Read/write failed (SMS only). |