Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef _ERRMSG_H
  2. #define _ERRMSG_H
  3. /* errmsg.h */
  4. /*****************************************************************************/
  5. /* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only                     */
  6. /*                                                                           */
  7. /* Cross Assembler                                                           */
  8. /*                                                                           */
  9. /* Error message definition & associated checking                            */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12.  
  13. #include "cpulist.h"
  14. #include "symflags.h"
  15. #include "datatypes.h"
  16.  
  17. typedef enum
  18. {
  19.   ErrNum_None = 0,
  20.   ErrNum_UselessDisp = 5,
  21.   ErrNum_ShortAddrPossible = 10,
  22.   ErrNum_ShortJumpPossible = 20,
  23.   ErrNum_NoShareFile = 30,
  24.   ErrNum_BigDecFloat = 40,
  25.   ErrNum_PrivOrder = 50,
  26.   ErrNum_DistNull = 60,
  27.   ErrNum_WrongSegment = 70,
  28.   ErrNum_InAccSegment = 75,
  29.   ErrNum_PhaseErr = 80,
  30.   ErrNum_Overlap = 90,
  31.   ErrNum_OverlapReg = 95,
  32.   ErrNum_NoCaseHit = 100,
  33.   ErrNum_InAccPage = 110,
  34.   ErrNum_RMustBeEven = 120,
  35.   ErrNum_Obsolete = 130,
  36.   ErrNum_Unpredictable = 140,
  37.   ErrNum_AlphaNoSense = 150,
  38.   ErrNum_Senseless = 160,
  39.   ErrNum_RepassUnknown = 170,
  40.   ErrNum_AddrNotAligned = 180,
  41.   ErrNum_IOAddrNotAllowed = 190,
  42.   ErrNum_Pipeline = 200,
  43.   ErrNum_DoubleAdrRegUse = 210,
  44.   ErrNum_NotBitAddressable = 220,
  45.   ErrNum_StackNotEmpty = 230,
  46.   ErrNum_NULCharacter = 240,
  47.   ErrNum_PageCrossing = 250,
  48.   ErrNum_WUnderRange = 255,
  49.   ErrNum_WOverRange = 260,
  50.   ErrNum_NegDUP = 270,
  51.   ErrNum_ConvIndX = 280,
  52.   ErrNum_NullResMem = 290,
  53.   ErrNum_BitNumberTruncated = 300,
  54.   ErrNum_InvRegisterPointer = 310,
  55.   ErrNum_MacArgRedef = 320,
  56.   ErrNum_Deprecated = 330,
  57.   ErrNum_SrcLEThanDest = 340,
  58.   ErrNum_TrapValidInstruction = 350,
  59.   ErrNum_PaddingAdded = 360,
  60.   ErrNum_RegNumWraparound = 370,
  61.   ErrNum_IndexedForIndirect = 380,
  62.   ErrNum_NotInNormalMode = 390,
  63.   ErrNum_NotInPanelMode = 400,
  64.   ErrNum_ArgOutOfRange = 410,
  65.   ErrNum_TrySkipMultiwordInstruction = 420,
  66.   ErrNum_SignExtension = 430,
  67.   ErrNum_MeansE = 440,
  68.   ErrNum_NeedShortIO = 450,
  69.   ErrNum_DoubleDef = 1000,
  70.   ErrNum_SymbolUndef = 1010,
  71.   ErrNum_InvSymName = 1020,
  72.   ErrNum_InvFormat = 1090,
  73.   ErrNum_UseLessAttr = 1100,
  74.   ErrNum_TooLongAttr = 1105,
  75.   ErrNum_UndefAttr = 1107,
  76.   ErrNum_WrongArgCnt = 1110,
  77.   ErrNum_CannotSplitArg = 1112,
  78.   ErrNum_WrongOptCnt = 1115,
  79.   ErrNum_OnlyImmAddr = 1120,
  80.   ErrNum_InvOpSize = 1130,
  81.   ErrNum_ConfOpSizes = 1131,
  82.   ErrNum_UndefOpSizes = 1132,
  83.   ErrNum_StringOrIntButFloat = 1133,
  84.   ErrNum_IntButFloat = 1134,
  85.   /* ErrNum_InvOpType = 1135, */
  86.   ErrNum_FloatButString = 1136,
  87.   ErrNum_OpTypeMismatch = 1137,
  88.   ErrNum_StringButInt = 1138,
  89.   ErrNum_StringButFloat = 1139,
  90.   ErrNum_TooManyArgs = 1140,
  91.   ErrNum_IntButString = 1141,
  92.   ErrNum_IntOrFloatButString = 1142,
  93.   ErrNum_ExpectString = 1143,
  94.   ErrNum_ExpectInt = 1144,
  95.   ErrNum_StringOrIntOrFloatButReg = 1145,
  96.   ErrNum_ExpectIntOrString = 1146,
  97.   ErrNum_ExpectReg = 1147,
  98.   ErrNum_RegWrongTarget = 1148,
  99.   ErrNum_FloatButInt = 1149,
  100.   ErrNum_NoRelocs = 1150,
  101.   ErrNum_IntOrFloatButReg = 1151,
  102.   ErrNum_IntOrStringButReg = 1152,
  103.   ErrNum_IntButReg = 1153,
  104.   ErrNum_UnresRelocs = 1155,
  105.   ErrNum_Unexportable = 1156,
  106.   ErrNum_UnknownInstruction = 1200,
  107.   ErrNum_BrackErr = 1300,
  108.   ErrNum_DivByZero = 1310,
  109.   ErrNum_UnderRange = 1315,
  110.   ErrNum_OverRange = 1320,
  111.   ErrNum_NotPwr2 = 1322,
  112.   ErrNum_NotAligned = 1325,
  113.   ErrNum_DistTooBig = 1330,
  114.   ErrNum_TargOnDiffPage = 1331,
  115.   ErrNum_InAccReg = 1335,
  116.   ErrNum_NoShortAddr = 1340,
  117.   ErrNum_InvAddrMode = 1350,
  118.   ErrNum_AddrMustBeEven = 1351,
  119.   ErrNum_AddrMustBeAligned = 1352,
  120.   ErrNum_InvParAddrMode = 1355,
  121.   ErrNum_UndefCond = 1360,
  122.   ErrNum_IncompCond = 1365,
  123.   ErrNum_UnknownFlag = 1366,
  124.   ErrNum_DuplicateFlag = 1367,
  125.   ErrNum_UnknownInt = 1368,
  126.   ErrNum_DuplicateInt = 1369,
  127.   ErrNum_JmpDistTooBig = 1370,
  128.   ErrNum_JmpDistIsZero = 1371,
  129.   ErrNum_DistIsOdd = 1375,
  130.   ErrNum_SkipTargetMismatch = 1376,
  131.   ErrNum_InvShiftArg = 1380,
  132.   ErrNum_Range18 = 1390,
  133.   ErrNum_Only1 = 1391,
  134.   ErrNum_ShiftCntTooBig = 1400,
  135.   ErrNum_InvRegList = 1410,
  136.   ErrNum_InvCmpMode = 1420,
  137.   ErrNum_InvCPUType = 1430,
  138.   ErrNum_InvFPUType = 1431,
  139.   ErrNum_InvPMMUType = 1432,
  140.   ErrNum_InvCtrlReg = 1440,
  141.   ErrNum_InvPMMUReg = 1444,
  142.   ErrNum_InvReg = 1445,
  143.   ErrNum_DoubleReg = 1446,
  144.   ErrNum_RegBankMismatch = 1447,
  145.   ErrNum_UndefRegSize = 1448,
  146.   ErrNum_InvOpOnReg = 1449,
  147.   ErrNum_NoSaveFrame = 1450,
  148.   ErrNum_NoRestoreFrame = 1460,
  149.   ErrNum_UnknownMacArg = 1465,
  150.   ErrNum_MissEndif = 1470,
  151.   ErrNum_InvIfConst = 1480,
  152.   ErrNum_DoubleSection = 1483,
  153.   ErrNum_InvSection = 1484,
  154.   ErrNum_MissingEndSect = 1485,
  155.   ErrNum_WrongEndSect = 1486,
  156.   ErrNum_NotInSection = 1487,
  157.   ErrNum_UndefdForward = 1488,
  158.   ErrNum_ContForward = 1489,
  159.   ErrNum_InvFuncArgCnt = 1490,
  160.   ErrNum_MsgMissingLTORG = 1495,
  161.   ErrNum_InstructionNotSupported = 1500,
  162.   ErrNum_FPUNotEnabled = 1501,
  163.   ErrNum_PMMUNotEnabled = 1502,
  164.   ErrNum_FullPMMUNotEnabled = 1503,
  165.   ErrNum_Z80SyntaxNotEnabled = 1504,
  166.   ErrNum_AddrModeNotSupported = 1505,
  167.   ErrNum_Z80SyntaxExclusive = 1506,
  168.   ErrNum_FPUInstructionNotSupported = 1507,
  169.   ErrNum_CustomNotEnabled = 1508,
  170.   ErrNum_InvBitPos = 1510,
  171.   ErrNum_OnlyOnOff = 1520,
  172.   ErrNum_StackEmpty = 1530,
  173.   ErrNum_NotOneBit = 1540,
  174.   ErrNum_MissingStruct = 1550,
  175.   ErrNum_OpenStruct = 1551,
  176.   ErrNum_WrongStruct = 1552,
  177.   ErrNum_PhaseDisallowed = 1553,
  178.   ErrNum_InvStructDir = 1554,
  179.   ErrNum_DoubleStruct = 1555,
  180.   ErrNum_UnresolvedStructRef = 1556,
  181.   ErrNum_DuplicateStructElem = 1557,
  182.   ErrNum_NotRepeatable = 1560,
  183.   ErrNum_ShortRead = 1600,
  184.   ErrNum_UnknownCodepage = 1610,
  185.   ErrNum_RomOffs063 = 1700,
  186.   ErrNum_InvFCode = 1710,
  187.   ErrNum_InvFMask = 1720,
  188.   ErrNum_InvMMUReg = 1730,
  189.   ErrNum_Level07 = 1740,
  190.   ErrNum_InvBitMask = 1750,
  191.   ErrNum_InvRegPair = 1760,
  192.   ErrNum_OpenMacro = 1800,
  193.   ErrNum_OpenIRP = 1801,
  194.   ErrNum_OpenIRPC = 1802,
  195.   ErrNum_OpenREPT = 1803,
  196.   ErrNum_OpenWHILE = 1804,
  197.   ErrNum_EXITMOutsideMacro = 1805,
  198.   ErrNum_TooManyMacParams = 1810,
  199.   ErrNum_UndefKeyArg = 1811,
  200.   ErrNum_NoPosArg = 1812,
  201.   ErrNum_DoubleMacro = 1815,
  202.   ErrNum_FirstPassCalc = 1820,
  203.   ErrNum_TooManyNestedIfs = 1830,
  204.   ErrNum_MissingIf = 1840,
  205.   ErrNum_RekMacro = 1850,
  206.   ErrNum_UnknownFunc = 1860,
  207.   ErrNum_InvFuncArg = 1870,
  208.   ErrNum_FloatOverflow = 1880,
  209.   ErrNum_InvArgPair = 1890,
  210.   ErrNum_NotOnThisAddress = 1900,
  211.   ErrNum_NotFromThisAddress = 1905,
  212.   ErrNum_JmpTargOnDiffPage = 1910,
  213.   ErrNum_TargOnDiffSection = 1911,
  214.   ErrNum_CodeOverflow = 1920,
  215.   ErrNum_AdrOverflow = 1925,
  216.   ErrNum_MixDBDS = 1930,
  217.   ErrNum_NotInStruct = 1940,
  218.   ErrNum_ParNotPossible = 1950,
  219.   ErrNum_InvSegment = 1960,
  220.   ErrNum_UnknownSegment = 1961,
  221.   ErrNum_UnknownSegReg = 1962,
  222.   ErrNum_InvString = 1970,
  223.   ErrNum_InvRegName = 1980,
  224.   ErrNum_InvArg = 1985,
  225.   ErrNum_NoIndir = 1990,
  226.   ErrNum_NotInThisSegment = 1995,
  227.   ErrNum_NotInMaxmode = 1996,
  228.   ErrNum_OnlyInMaxmode = 1997,
  229.   ErrNum_PackCrossBoundary = 2000,
  230.   ErrNum_UnitMultipleUsed = 2001,
  231.   ErrNum_MultipleLongRead = 2002,
  232.   ErrNum_MultipleLongWrite = 2003,
  233.   ErrNum_LongReadWithStore = 2004,
  234.   ErrNum_TooManyRegisterReads = 2005,
  235.   ErrNum_OverlapDests = 2006,
  236.   ErrNum_TooManyBranchesInExPacket = 2008,
  237.   ErrNum_CannotUseUnit = 2009,
  238.   ErrNum_InvEscSequence = 2010,
  239.   ErrNum_InvPrefixCombination = 2020,
  240.   ErrNum_ConstantRedefinedAsVariable = 2030,
  241.   ErrNum_VariableRedefinedAsConstant = 2035,
  242.   ErrNum_StructNameMissing = 2040,
  243.   ErrNum_EmptyArgument = 2050,
  244.   ErrNum_Unimplemented = 2060,
  245.   ErrNum_FreestandingUnnamedStruct = 2070,
  246.   ErrNum_STRUCTEndedByENDUNION = 2080,
  247.   ErrNum_AddrOnDifferentPage = 2090,
  248.   ErrNum_UnknownMacExpMod = 2100,
  249.   ErrNum_TooManyMacExpMod = 2105,
  250.   ErrNum_ConflictingMacExpMod = 2110,
  251.   ErrNum_InvalidPrepDir = 2120,
  252.   ErrNum_ExpectedError = 2130,
  253.   ErrNum_NoNestExpect = 2140,
  254.   ErrNum_MissingENDEXPECT = 2150,
  255.   ErrNum_MissingEXPECT = 2160,
  256.   ErrNum_NoDefCkptReg = 2170,
  257.   ErrNum_InvBitField = 2180,
  258.   ErrNum_ArgValueMissing = 2190,
  259.   ErrNum_UnknownArg = 2200,
  260.   ErrNum_IndexRegMustBe16Bit = 2210,
  261.   ErrNum_IOAddrRegMustBe16Bit = 2211,
  262.   ErrNum_SegAddrRegMustBe32Bit = 2212,
  263.   ErrNum_NonSegAddrRegMustBe16Bit = 2213,
  264.   ErrNum_InvStructArgument = 2220,
  265.   ErrNum_TooManyArrayDimensions = 2221,
  266.   ErrNum_InvIntFormat = 2230,
  267.   ErrNum_InvIntFormatList = 2231,
  268.   ErrNum_InvScale = 2240,
  269.   ErrNum_ConfStringOpt = 2250,
  270.   ErrNum_UnknownStringOpt = 2251,
  271.   ErrNum_InvCacheInvMode = 2252,
  272.   ErrNum_InvCfgList = 2253,
  273.   ErrNum_ConfBitBltOpt = 2254,
  274.   ErrNum_UnknownBitBltOpt = 2255,
  275.   ErrNum_InvCBAR = 2260,
  276.   ErrNum_InAccPageErr = 2270,
  277.   ErrNum_InAccFieldErr = 2280,
  278.   ErrNum_TargInDiffField = 2281,
  279.   ErrNum_InvCombination = 2290,
  280.   ErrNum_UnmappedChar = 2300,
  281.   ErrNum_MultiCharInvLength = 2310,
  282.   ErrNum_NoTarget = 2320,
  283.   ErrNum_UserError = 9990,
  284.   ErrNum_InternalError = 10000,
  285.   ErrNum_OpeningFile = 10001,
  286.   ErrNum_ListWrError = 10002,
  287.   ErrNum_FileReadError = 10003,
  288.   ErrNum_FileWriteError = 10004,
  289.   ErrNum_HeapOvfl = 10006,
  290.   ErrNum_StackOvfl = 10007,
  291.   ErrNum_MaxIncLevelExceeded = 10008
  292. } tErrorNum;
  293.  
  294. struct sLineComp;
  295. struct sStrComp;
  296.  
  297. extern Boolean ChkRangePos(LargeInt Value, LargeInt Min, LargeInt Max, const struct sStrComp *p_comp);
  298. #define ChkRange(Value, Min, Max) ChkRangePos(Value, Min, Max, NULL)
  299. extern Boolean ChkRangeWarnPos(LargeInt Value, LargeInt Min, LargeInt Max, const struct sStrComp *p_comp);
  300. #define ChkRangeWarn(Value, Min, Max) ChkRangeWarnPos(Value, Min, Max, NULL)
  301.  
  302. extern Boolean ChkArgCntExtPos(int ThisCnt, int MinCnt, int MaxCnt, const struct sLineComp *pComp);
  303. #define ChkArgCnt(MinCnt, MaxCnt) ChkArgCntExtPos(ArgCnt, MinCnt, MaxCnt, NULL)
  304. #define ChkArgCntExt(ThisCnt, MinCnt, MaxCnt) ChkArgCntExtPos(ThisCnt, MinCnt, MaxCnt, NULL)
  305. extern Boolean ChkArgCntExtEitherOr(int ThisCnt, int EitherCnt, int OrCnt);
  306.  
  307. extern Boolean ChkMinCPUExt(CPUVar MinCPU, tErrorNum ErrorNum);
  308. #define ChkMinCPU(MinCPU) ChkMinCPUExt(MinCPU, ErrNum_InstructionNotSupported)
  309.  
  310. extern Boolean AChkMinCPUExtPos(CPUVar MinCPU, tErrorNum ErrorNum, const struct sStrComp *pComp);
  311. #define AChkMinCPUPos(MinCPU, pComp) AChkMinCPUExtPos(MinCPU, ErrNum_AddrModeNotSupported, pComp)
  312.  
  313. extern Boolean ChkMaxCPUExt(CPUVar MaxCPU, tErrorNum ErrorNum);
  314. #define ChkMaxCPU(MaxCPU) ChkMaxCPUExt(MaxCPU, ErrNum_InstructionNotSupported)
  315.  
  316. extern Boolean ChkExactCPUExt(CPUVar CheckCPU, tErrorNum ErrorNum);
  317. #define ChkExactCPU(CheckCPU) ChkExactCPUExt(CheckCPU, ErrNum_InstructionNotSupported)
  318.  
  319. extern Boolean ChkRangeCPUExt(CPUVar MinCPU, CPUVar MaxCPU, tErrorNum ErrorNum);
  320. #define ChkRangeCPU(MinCPU, MaxCPU) ChkRangeCPUExt(MinCPU, MaxCPU, ErrNum_InstructionNotSupported)
  321.  
  322. extern Boolean ChkExcludeCPUExt(CPUVar CheckCPU, tErrorNum ErrorNum);
  323. #define ChkExcludeCPU(CheckCPU) ChkExcludeCPUExt(CheckCPU, ErrNum_InstructionNotSupported)
  324.  
  325. extern int ChkExactCPUList(int ErrorNum, ...);
  326. extern int ChkExcludeCPUList(int ErrorNum, ...);
  327.  
  328. extern int ChkExactCPUMaskExt(Word CPUMask, CPUVar FirstCPU, tErrorNum ErrorNum);
  329. #define ChkExactCPUMask(CPUMask, FirstCPU) ChkExactCPUMaskExt(CPUMask, FirstCPU, ErrNum_InstructionNotSupported)
  330.  
  331. extern Boolean ChkSamePage(LargeWord CurrAddr, LargeWord DestAddr, unsigned PageBits, tSymbolFlags DestFlags);
  332.  
  333. #endif /* _ERRMSG_H */
  334.