move operator-to-string conversion to unit.c
[xorcyst.git] / objdef.h
blob0dcedafc761baeb850612abbc539af8aa97da0f3
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 XASM_MAGIC 0xFACE
45 /* Version number; major in high nibble, minor in low nibble */
46 #define XASM_OBJ_VERSION 0x14
48 /* Possible kinds of datatypes/symbols/etc */
49 #define XASM_INT_8 0x01
50 #define XASM_INT_16 0x02
51 #define XASM_INT_24 0x03
52 #define XASM_INT_32 0x04
53 #define XASM_STR_8 0x05
54 #define XASM_STR_16 0x06
55 #define XASM_EXTRN 0x07
56 #define XASM_LOCAL 0x08
57 #define XASM_PC 0x09
59 /* Expression operators */
60 #define XASM_OP_PLUS 0x10
61 #define XASM_OP_MINUS 0x11
62 #define XASM_OP_MUL 0x12
63 #define XASM_OP_DIV 0x13
64 #define XASM_OP_MOD 0x14
65 #define XASM_OP_SHL 0x15
66 #define XASM_OP_SHR 0x16
67 #define XASM_OP_AND 0x17
68 #define XASM_OP_OR 0x18
69 #define XASM_OP_XOR 0x19
70 #define XASM_OP_EQ 0x1A
71 #define XASM_OP_NE 0x1B
72 #define XASM_OP_LT 0x1C
73 #define XASM_OP_GT 0x1D
74 #define XASM_OP_LE 0x1E
75 #define XASM_OP_GE 0x1F
76 #define XASM_OP_NOT 0x20
77 #define XASM_OP_NEG 0x21
78 #define XASM_OP_LO 0x22
79 #define XASM_OP_HI 0x23
80 #define XASM_OP_UMINUS 0x24
81 #define XASM_OP_BANK 0x25
83 /* Bytecode commands */
84 #define XASM_CMD_FILE 0xEE /* Operands: 8-bit count, string (filename) */
85 #define XASM_CMD_LINE8 0xEF /* Operands: 8-bit line number */
86 #define XASM_CMD_LINE16 0xF0 /* Operands: 16-bit line number */
87 #define XASM_CMD_LINE24 0xF1 /* Operands: 24-bit line number */
88 #define XASM_CMD_LINE_INC 0xF2 /* Operands: None */
89 #define XASM_CMD_END 0xF3 /* Operands: None */
90 #define XASM_CMD_BIN8 0xF4 /* Operands: 8-bit count, string of bytes */
91 #define XASM_CMD_BIN16 0xF5 /* Operands: 16-bit count, string of bytes */
92 #define XASM_CMD_LABEL 0xF6 /* Operands: export flag byte, name (if export flag set) */
93 #define XASM_CMD_INSTR 0xF7 /* Operands: 6502 opcode, 16-bit expression ID */
94 #define XASM_CMD_DB 0xF8 /* Operands: 16-bit expression ID */
95 #define XASM_CMD_DW 0xF9 /* Operands: 16-bit expression ID */
96 #define XASM_CMD_DD 0xFA /* Operands: 16-bit expression ID */
97 #define XASM_CMD_DSI8 0xFB /* Operands: 8-bit count */
98 #define XASM_CMD_DSI16 0xFC /* Operands: 16-bit count */
99 #define XASM_CMD_DSB 0xFD /* Operands: 16-bit expression ID */
100 #define XASM_CMD_RSV1 0xFE /* Reserved 1 */
101 #define XASM_CMD_RSV2 0xFF /* Reserved 2 */
103 /* Bitmasks for CMD_LABEL flag byte */
104 #define XASM_LABEL_FLAG_EXPORT 1
105 #define XASM_LABEL_FLAG_ZEROPAGE 2
106 #define XASM_LABEL_FLAG_ALIGN 4
107 #define XASM_LABEL_FLAG_ADDR 8
109 #endif /* !OBJDEF_H */