/* Error handling
Copyright 1998-2005 James Bowman, Craig Franklin
Copyright 2012 Borut Ražem
Copyright 2015-2016 Molnár Károly
*/
#pragma once
#include "stdhdr.h"
enum GP_codes {
/* Error codes
*
* The error codes gpasm defines here are identical to MPASM's
* definitions. Additional gpasm definitions follow the last
* MPASM definition.
*
*/
GPE_USER = 101,
GPE_NOMEM = 102,
GPE_SYMFULL = 103,
GPE_TEMPFILE = 104,
GPE_NOENT = 105, /* File or directory not found */
GPE_STRCPLX = 106,
GPE_BADDIGIT = 107,
GPE_BADCHAR = 108,
GPE_OPENPAR = 109, /* Mis-matched open parenthesis */
GPE_CLOSEPAR = 110, /* Mis-matched closed parenthesis */
GPE_MISSYM = 111, /* No symbol in an EQU or SET */
GPE_NOOP = 112, /* Missing an arithmetic operator */
GPE_SYM_NOT_DEFINED = 113, /* Symbol has not been defined */
GPE_DIVBY0 = 114,
GPE_DUPLAB = 115,
GPE_DIFFLAB = 116,
GPE_ADDROVF = 117, /* address overflow */
GPE_ADDROVR = 118, /* overwriting a previously written address */
GPE_BAD_CALL_ADDR = 120,
GPE_ILLEGAL_LABEL = 121,
GPE_ILLEGAL_DIR = 123,
GPE_ILLEGAL_ARGU = 124,
GPE_ILLEGAL_COND = 125,
GPE_OUT_OF_RANGE = 126, /* Argument out of range */
GPE_TOO_MANY_ARGU = 127,
GPE_MISSING_ARGU = 128,
GPE_EXPECTED = 129,
GPE_EXTRA_PROC = 130,
GPE_UNDEF_PROC = 131,
GPE_UNKNOWN_PROC = 132,
GPE_IHEX = 133, /* Hex file format is too small for code */
GPE_NO_MACRO_NAME = 135,
GPE_DUPLICATE_MACRO = 136,
GPE_BAD_WHILE_LOOP = 140,
GPE_ILLEGAL_NESTING = 143,
GPE_UNMATCHED_ENDM = 145,
GPE_OBJECT_ONLY = 149,
GPE_LABEL_IN_SECTION = 150,
GPE_UNRESOLVABLE = 151,
GPE_WRONG_SECTION = 152,
GPE_CONTIG_SECTION = 154,
GPE_MUST_BE_LABEL = 156,
GPE_ORG_ODD = 157,
GPE_FILL_ODD = 159,
GPE_CONTIG_CONFIG = 163,
GPE_CONTIG_IDLOC = 164,
GPE_NO_EXTENDED_MODE = 165, /* Extended mode not available for this device */
GPE_MISSING_BRACKET = 168,
GPE_CONSTANT = 170, /* Expression within brackets must be constant */
GPE_IDLOCS_ORDER = 175,
GPE_CONFIG_UNKNOWN = 176,
GPE_CONFIG_usCONFIG = 177,
GPE_RES_ODD_PIC16EA = 180,
GPE_UNKNOWN = 181,
/* gputils special errors */
GPE_INTERNAL = 1101, /* Internal error */
GPE_PARSER = 1102, /* Parser error */
GPE_SCANNER = 1103, /* Scanner error */
GPE_IDLOCS_P16E = 1501, /* IDLOCS directive use solely to the PIC16E family. */
GPE_NO_DEST = 1502, /* The destination of the storage is not selected. */
GPE_NO_ACC = 1503, /* The access of RAM is not selected. */
GPE_TOO_LONG = 1504, /* A string too long. */
GPE_IN_OF_ACCRAM = 1505, /* A register is located on the Access RAM. */
GPE_OUT_OF_ACCRAM = 1506, /* A register is not located on the Access RAM. */
GPE_OUT_OF_BANK = 1507,
GPE_INVALID_RAM = 1508,
GPE_INVALID_ROM = 1509,
GPE_EXCEED_ROM = 1510,
GPE_SYM_NO_VALUE = 1511,
GMSG_ERR_LEVEL0_MIN = GPE_USER,
GMSG_ERR_LEVEL0_MAX = GPE_UNKNOWN,
GMSG_ERR_LEVEL1_MIN = GPE_IDLOCS_P16E,
GMSG_ERR_LEVEL1_MAX = GPE_INVALID_ROM,
/* Warning codes
*
* The warning codes gpasm defines here are identical to MPASM's
* definitions. Additional gpasm definitions follow the last
* MPASM definition.
*
*/
GPW_SYM_NOT_DEFINED = 201,
GPW_OUT_OF_RANGE = 202, /* Argument out of range */
GPW_OP_COLUMN_ONE = 203,
GPW_DIR_COLUMN_ONE = 205,
GPW_MACRO_COLUMN_ONE = 206,
GPW_LABEL_COLUMN = 207,
GPW_MISSING_QUOTE = 209,
GPW_EXTRANEOUS = 211,
GPW_EXPECTED = 212,
GPW_CMDLINE_PROC = 215,
GPW_CMDLINE_RADIX = 216,
GPW_CMDLINE_HEXFMT = 217,
GPW_RADIX = 218,
GPW_INVALID_RAM = 219,
GPW_EXCEED_ROM = 220,
GPW_DISABLE_ERROR = 222,
GPW_REDEFINING_PROC = 223,
GPW_NOT_RECOMMENDED = 224,
GPW_WORD_ALIGNED = 226,
GPW_INVALID_ROM = 228,
GPW_UNKNOWN = 231,
/* gputils special warnings */
GPW_BANK_PAGE_SEL_AFTER_SKIP = 1201, /* %s after skip instruction. I this really what you intended? */
GPW_UNDEF_PROC = 1202,
GPW_IN_OF_ACCRAM = 1203, /* A register is located on the Access RAM. */
GPW_OUT_OF_ACCRAM = 1204, /* A register is not located on the Access RAM. */
GPW_NO_DEST = 1205, /* The destination of the storage is not selected. */
GPW_OUT_OF_BANK = 1206,
GPW_STRING_TRUNCATE = 1207,
GPW_SYM_NO_VALUE = 1208,
GPW_USER = 1299,
// GMSG_WARN_LEVEL0_MIN = GPW_NOT_DEFINED,
GMSG_WARN_LEVEL0_MAX = GPW_UNKNOWN,
GMSG_WARN_LEVEL1_MIN = GPW_BANK_PAGE_SEL_AFTER_SKIP,
GMSG_WARN_LEVEL1_MAX = GPW_USER,
/* Message codes
*
* The message codes gpasm defines here are identical to MPASM's
* definitions. Additional gpasm definitions follow the last
* MPASM definition.
*
*/
GPM_USER = 301, /* User supplied message */
GPM_OUT_OF_BANK = 302,
GPM_OUT_OF_RANGE = 303,
GPM_IDLOC = 304,
GPM_NO_DEST = 305,
GPM_PAGE_BOUNDARY = 306,
GPM_PAGEBITS = 307,
GPM_SUPVAL = 308,
GPM_SUPLIN = 309,
GPM_SUPRAM = 310,
GPM_EXT_BANK_OR_PAGE = 312,
GPM_CBLOCK = 313,
GPM_W_MODIFIED = 316,
GPM_SPECIAL_MNEMONIC = 318,
GPM_UNKNOWN = 319,
/* gputils special messages */
GPM_ACC_DEF = 1301,
GPM_NO_BANK = 1302,
GPM_EXT_BANK = 1303,
GPM_EXT_PAGE = 1304,
GMSG_MSG_LEVEL0_MIN = GPM_USER,
GMSG_MSG_LEVEL0_MAX = GPM_UNKNOWN,
GMSG_MSG_LEVEL1_MIN = GPM_ACC_DEF,
GMSG_MSG_LEVEL1_MAX = GPM_EXT_PAGE,
};
EXTERN_C void gpmsg_init(void);
EXTERN_C void gpmsg_close(void);
EXTERN_C void gpmsg_add_code(int Code);
EXTERN_C void gpmsg_add_code_range(int Code0, int Code1);
EXTERN_C void gpmsg0(enum GP_codes Code, const char* Message);
EXTERN_C void _cdecl gpmsg(enum GP_codes Code, const char* Message, ...);
Vorgefundene Kodierung: UTF-8 | 0
|