| 1 | //cxx . . $ `<file>/src/asm/alu.h`/ |
| 2 | // ACME - a crossassembler for producing 6502/65c02/65816 code. |
| 3 | // Copyright (C) 1998-2006 Marco Baye |
| 4 | // Have a look at "acme.c" for further info |
| 5 | // |
| 6 | // ALU stuff (the expression parser) |
| 7 | #ifndef alu_H |
| 8 | #define alu_Hcxx . . $ `src/asm/alu.h:8:9`! |
| 9 | |
| 10 | #include "config.h"cxx . . $ `<file>/src/asm/config.h`/ |
| 11 | |
| 12 | |
| 13 | // Constants |
| 14 | |
| 15 | // Meaning of bits in "flags" of result_t and result_int_t structures: |
| 16 | #define MVALUE_IS_FPcxx . . $ `src/asm/alu.h:16:9`! (1u << 8) |
| 17 | // Floating point value (never set in result_int_t) |
| 18 | #define MVALUE_INDIRECTcxx . . $ `src/asm/alu.h:18:9`! (1u << 7) |
| 19 | // Needless parentheses indicate use of indirect addressing modes |
| 20 | #define MVALUE_EXISTScxx . . $ `src/asm/alu.h:20:9`! (1u << 6) |
| 21 | // 0: expression was empty. 1: there was *something* to parse. |
| 22 | #define MVALUE_UNSUREcxx . . $ `src/asm/alu.h:22:9`! (1u << 5) |
| 23 | // Value once was related to undefined expression. Needed for producing |
| 24 | // the same addresses in all passes; because in the first pass there |
| 25 | // will almost for sure be labels that are undefined, you can't simply |
| 26 | // get the addressing mode from looking at the parameter's value. |
| 27 | #define MVALUE_DEFINEDcxx . . $ `src/asm/alu.h:27:9`! (1u << 4) |
| 28 | // 0: undefined expression (value will be zero). 1: known result |
| 29 | #define MVALUE_ISBYTEcxx . . $ `src/asm/alu.h:29:9`! (1u << 3) |
| 30 | // Value is guaranteed to fit in one byte |
| 31 | #define MVALUE_FORCE24cxx . . $ `src/asm/alu.h:31:9`! (1u << 2) |
| 32 | // Value usage forces 24-bit usage |
| 33 | #define MVALUE_FORCE16cxx . . $ `src/asm/alu.h:33:9`! (1u << 1) |
| 34 | // Value usage forces 16-bit usage |
| 35 | #define MVALUE_FORCE08cxx . . $ `src/asm/alu.h:35:9`! (1u << 0) |
| 36 | // Value usage forces 8-bit usage |
| 37 | #define MVALUE_FORCEBITScxx . . $ `src/asm/alu.h:37:9`! (MVALUE_FORCE08|MVALUE_FORCE16|MVALUE_FORCE24) |
| 38 | #define MVALUE_GIVENcxx . . $ `src/asm/alu.h:38:9`! (MVALUE_DEFINED | MVALUE_EXISTS) |
| 39 | // Bit mask for fixed values (defined and existing) |
| 40 | |
| 41 | |
| 42 | // Prototypes |
| 43 | |
| 44 | // create dynamic buffer, operator/function trees and operator/operand stacks |
| 45 | extern void ALU_initcxx . . $ ALU_init(49f6e7a06ebc5aa8).(void); |
| 46 | // Activate error output for "value undefined" |
| 47 | extern void ALU_throw_errorscxx . . $ ALU_throw_errors(49f6e7a06ebc5aa8).(void); |
| 48 | // returns int value (0 if result was undefined) |
| 49 | extern intval_tcxx . . $ intval_t# ALU_any_intcxx . . $ ALU_any_int(da6335ded91d79c2).(void); |
| 50 | // returns int value (if result was undefined, serious error is thrown) |
| 51 | extern intval_tcxx . . $ intval_t# ALU_defined_intcxx . . $ ALU_defined_int(da6335ded91d79c2).(void); |
| 52 | // stores int value if given. Returns whether stored. Throws error if undefined. |
| 53 | extern boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! ALU_optional_defined_intcxx . . $ ALU_optional_defined_int(c894b17f3c089378).(intval_tcxx . . $ intval_t#*); |
| 54 | // stores int value and flags (floats are transformed to int) |
| 55 | extern void ALU_int_resultcxx . . $ ALU_int_result(1ba379088691677b).(result_int_tcxx . . $ result_int_t#*); |
| 56 | // stores int value and flags, allowing for one '(' too many (x-indirect addr) |
| 57 | extern int ALU_liberal_intcxx . . $ ALU_liberal_int(ee210d144587f61c).(result_int_tcxx . . $ result_int_t#*); |
| 58 | // stores value and flags (result may be either int or float) |
| 59 | extern void ALU_any_resultcxx . . $ ALU_any_result(64a63ef514ec9b8a).(result_tcxx . . $ result_t#*); |
| 60 | |
| 61 | |
| 62 | #endif |