-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathoperstuff.dat
More file actions
103 lines (97 loc) · 5.16 KB
/
Copy pathoperstuff.dat
File metadata and controls
103 lines (97 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
; A semi-colon in column 1 signals a comment line for this file and ignored.
; Except for the comment char, anything other than a 'E' in column 1 will be copied
; without modification to the output file: (expected to be operstuff.h)
;
/*
operstuff.h - Part of macxx, a cross assembler family for various micro-processors
Copyright (C) 2025 David Shepperd
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**************************************************************************
* @note This file is produced by a separate program called mk_operstuff. *
* Any manual edits made to this file will likely be lost during the next *
* build. Edit mk_operstuff.c and/or operstuff.dat to make any necessary *
* changes to these lists. *
**************************************************************************/
; The following items are separated from one another using commas with
; any amount of whitespace between them. Whitespace in the comment string
; is copied to output as is.
;
; Higher numbered precendence wins. The "Normal" precedence table defines
; that of a 'C' style expression. The "None" precedence table defines the
; default macxx expression style where all operators have equal precendence.
;
; The assembler pseudo op ".ENABLE PRECEDENCE" switches from "None" to "Normal".
; The pseudo op ".DSABL PRECEDENCE" switches from "Normal" to "None".
; The mac8080 assembler defaults to '.ENABLE PRECEDENCE'. All the others
; default to '.DSABLE PRECEDENCE'.
;
;
;The following list has to start with 'E' to get the contents loaded into the
;expected enum and structs.
; Precedences
;Numeric ID Operator in object file Normal None Comment
EXPRS_TERM_NULL, ('L'<<8)|'N', 20, 20, /* f (NULL) */
EXPRS_TERM_SYMBOL, ('Y'<<8)|'S', 20, 20, /* f (Symbol) */
EXPRS_TERM_INTEGER, ('N'<<8)|'I', 20, 20, /* f (int) */
EXPRS_TERM_NEG, EXPROPER_NEG, 18, 18, /* - (neg) */
EXPRS_TERM_POS, EXPROPER_ADD, 18, 18, /* + (pos) */
EXPRS_TERM_COM, EXPROPER_COM, 18, 18, /* ~ (comp) */
EXPRS_TERM_NOT, (EXPROPER_TST_NOT<<8)|EXPROPER_TST, 18, 18, /* ! (not) */
EXPRS_TERM_LOW_BYTE, ('v'<<8)|'^', 16, 18, /* ^v (low byte) */
EXPRS_TERM_HIGH_BYTE, ('^'<<8)|'^', 16, 18, /* ^^ (high byte) */
EXPRS_TERM_SWAP, EXPROPER_SWAP, 16, 18, /* ^~ (swap) */
EXPRS_TERM_MUL, EXPROPER_MUL, 14, 7, /* * (mul) */
EXPRS_TERM_DIV, EXPROPER_DIV, 14, 7, /* / (div) */
EXPRS_TERM_UDIV, EXPROPER_USD, 14, 7, /* / (udiv) */
EXPRS_TERM_MOD, EXPROPER_MOD, 14, 7, /* % (mod) */
EXPRS_TERM_ADD, EXPROPER_ADD, 12, 7, /* + (add) */
EXPRS_TERM_SUB, EXPROPER_SUB, 12, 7, /* - (sub) */
EXPRS_TERM_SHL, EXPROPER_SHL, 10, 7, /* << (shl) */
EXPRS_TERM_SHR, EXPROPER_SHR, 10, 7, /* >> (shr) */
EXPRS_TERM_GT, (EXPROPER_TST_GT<<8)|EXPROPER_TST, 8, 7, /* > (gt) */
EXPRS_TERM_GE, (EXPROPER_TST_GE<<8)|EXPROPER_TST, 8, 7, /* >= (ge) */
EXPRS_TERM_LT, (EXPROPER_TST_LT<<8)|EXPROPER_TST, 8, 7, /* < (lt) */
EXPRS_TERM_LE, (EXPROPER_TST_LE<<8)|EXPROPER_TST, 8, 7, /* <= (le) */
EXPRS_TERM_EQ, (EXPROPER_TST_EQ<<8)|EXPROPER_TST, 8, 7, /* == (eq) */
EXPRS_TERM_NE, (EXPROPER_TST_NE<<8)|EXPROPER_TST, 8, 7, /* != (ne) */
EXPRS_TERM_AND, EXPROPER_AND, 6, 7, /* & (and) */
EXPRS_TERM_XOR, EXPROPER_XOR, 5, 7, /* ^ (xor) */
EXPRS_TERM_OR, EXPROPER_OR, 4, 7, /* | (or) */
EXPRS_TERM_LAND, (EXPROPER_TST_AND<<8)|EXPROPER_TST, 3, 7, /* && (land) */
EXPRS_TERM_LOR, (EXPROPER_TST_OR<<8)|EXPROPER_TST, 2, 7, /* || (lor) */
;
;
; Error definitions and descriptions. The following has to begin with a 'B,' to get them loaded
; into the expected enum and struct.
;
B, EXPR_TERM_GOOD, "Success"
B, EXPR_TERM_END, "End of expression"
B, EXPR_TERM_BAD_NO_STRING_TERM, "Not a string term"
B, EXPR_TERM_BAD_STRING_TOO_LONG, "String too long"
B, EXPR_TERM_BAD_STRINGS_NOT_SUPPORTED,"Function not supported"
B, EXPR_TERM_BAD_SYMBOL_SYNTAX, "Bad symbol syntax"
B, EXPR_TERM_BAD_SYMBOL_TOO_LONG, "Symbol name too long"
B, EXPR_TERM_BAD_NUMBER, "Bad number syntax"
B, EXPR_TERM_BAD_UNARY, "Bad unary"
B, EXPR_TERM_BAD_OPER, "Undefined operator"
B, EXPR_TERM_BAD_SYNTAX, "Unrecognized syntax"
B, EXPR_TERM_BAD_TOO_MANY_TERMS, "Too many terms"
B, EXPR_TERM_BAD_TOO_FEW_TERMS, "Too few terms"
B, EXPR_TERM_BAD_NO_TERMS, "No terms found"
B, EXPR_TERM_BAD_NO_CLOSE, "No expression close"
B, EXPR_TERM_BAD_UNSUPPORTED, "Unsupported function"
B, EXPR_TERM_BAD_DIV_BY_0, "Divide by 0"
B, EXPR_TERM_BAD_PARAMETER, "Bad parameter passed"
B, EXPR_TERM_BAD_UNDEFINED, "Undefined expression context"
B, EXPR_TERM_BAD_OUT_OF_MEMORY, "Ran out of memory"
B, EXPR_TERM_BAD_UNDEFINED_SYMBOL, "Undefined symbol"