2 ; Ullrich von Bassewitz, 17.07.2002
4 ; const char* __fastcall__ _stroserror (unsigned char errcode);
5 ; /* Map an operating system error number to an error message. */
9 .import __sys_oserrlist
15 ; The table is built as a list of entries
21 ; and terminated by an entry with length zero that is returned if the
22 ; error code could not be found.
25 sta tmp1 ; Save the error code
30 sty ptr1+1 ; Setup pointer to message table
33 lda (ptr1),y ; Get the length
34 beq Done ; Bail out if end of list reached
37 lda (ptr1),y ; Compare the error code
39 beq Done ; Jump if found
41 ; Not found, move pointer to next entry
50 bcs @L1 ; Branch always
52 ; We've found the code or reached the end of the list
56 add #2 ; Add a total of #2