sanity checking of ram allocation (if the algorithm is correct it's not necessary...
[xorcyst.git] / objdef.h
blobf834f45f0a5d5d804a1dd62b5980bdd5935d337b
1 /*
2 * $Id: objdef.h,v 1.5 2007/07/22 13:35:20 khansen Exp $
3 * $Log: objdef.h,v $
4 * Revision 1.5 2007/07/22 13:35:20 khansen
5 * convert tabs to whitespaces
7 * Revision 1.4 2004/12/19 20:46:59 kenth
8 * xorcyst 1.4.0
10 * Revision 1.3 2004/12/18 17:02:58 kenth
11 * added some LINE commands
13 * Revision 1.2 2004/12/14 01:51:29 kenth
14 * CMD_LINE and CMD_FILE defines
16 * Revision 1.1 2004/06/30 07:56:32 kenth
17 * Initial revision
21 /**
22 * (C) 2004 Kent Hansen
24 * The XORcyst is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by
26 * the Free Software Foundation; either version 2 of the License, or
27 * (at your option) any later version.
29 * The XORcyst is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with The XORcyst; if not, write to the Free Software
36 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 #ifndef OBJDEF_H
40 #define OBJDEF_H
42 /* "It's a kind of magic" */
43 #define A_MAGIC 0xFACE
45 /* Version number; major in high nibble, minor in low nibble */
46 #define A_VERSION 0x14
48 /* Possible kinds of datatypes/symbols/etc */
49 #define INT_8 0x01
50 #define INT_16 0x02
51 #define INT_24 0x03
52 #define INT_32 0x04
53 #define STR_8 0x05
54 #define STR_16 0x06
55 #define EXTRN 0x07
56 #define LOCAL 0x08
57 #define PC 0x09
59 /* Expression operators */
60 #define OP_PLUS 0x10
61 #define OP_MINUS 0x11
62 #define OP_MUL 0x12
63 #define OP_DIV 0x13
64 #define OP_MOD 0x14
65 #define OP_SHL 0x15
66 #define OP_SHR 0x16
67 #define OP_AND 0x17
68 #define OP_OR 0x18
69 #define OP_XOR 0x19
70 #define OP_EQ 0x1A
71 #define OP_NE 0x1B
72 #define OP_LT 0x1C
73 #define OP_GT 0x1D
74 #define OP_LE 0x1E
75 #define OP_GE 0x1F
76 #define OP_NOT 0x20
77 #define OP_NEG 0x21
78 #define OP_LO 0x22
79 #define OP_HI 0x23
80 #define OP_UMINUS 0x24
81 #define OP_BANK 0x25
83 /* Bytecode commands */
84 #define CMD_FILE 0xEE /* Operands: 8-bit count, string (filename) */
85 #define CMD_LINE8 0xEF /* Operands: 8-bit line number */
86 #define CMD_LINE16 0xF0 /* Operands: 16-bit line number */
87 #define CMD_LINE24 0xF1 /* Operands: 24-bit line number */
88 #define CMD_LINE_INC 0xF2 /* Operands: None */
89 #define CMD_END 0xF3 /* Operands: None */
90 #define CMD_BIN8 0xF4 /* Operands: 8-bit count, string of bytes */
91 #define CMD_BIN16 0xF5 /* Operands: 16-bit count, string of bytes */
92 #define CMD_LABEL 0xF6 /* Operands: export flag byte, name (if export flag set) */
93 #define CMD_INSTR 0xF7 /* Operands: 6502 opcode, 16-bit expression ID */
94 #define CMD_DB 0xF8 /* Operands: 16-bit expression ID */
95 #define CMD_DW 0xF9 /* Operands: 16-bit expression ID */
96 #define CMD_DD 0xFA /* Operands: 16-bit expression ID */
97 #define CMD_DSI8 0xFB /* Operands: 8-bit count */
98 #define CMD_DSI16 0xFC /* Operands: 16-bit count */
99 #define CMD_DSB 0xFD /* Operands: 16-bit expression ID */
100 #define CMD_RSV1 0xFE /* Reserved 1 */
101 #define CMD_RSV2 0xFF /* Reserved 2 */
103 /* Bitmasks for CMD_LABEL flag byte */
104 #define LABEL_FLAG_EXPORT 1
105 #define LABEL_FLAG_ZEROPAGE 2
106 #define LABEL_FLAG_ALIGN 4
107 #define LABEL_FLAG_ADDR 8
109 #endif /* !OBJDEF_H */