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
|
/*
* HT Editor
* srt.h
*
* Copyright (C) 2001 Stefan Weyergraf (stefan@weyergraf.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SRT_H__
#define __SRT_H__
#include "analy.h"
#include "symmath.h"
enum srt_endian { srte_be, srte_le };
/*
* CLASS state_mod
*/
#define MTYPE_REG 0
#define MTYPE_FLAG 1
#define MTYPE_MEM 2
class state_mod: public ht_data {
public:
bool ismem;
union {
UINT regidx;
struct {
sym_int *addr;
UINT size;
srt_endian endian;
} mem;
} dest;
bool isbool;
union {
sym_int *integer;
sym_bool *boolean;
} value;
~state_mod();
};
/*
* CLASS sym_int_reg
*/
class sym_int_reg: public sym_int_token {
public:
UINT regidx;
sym_int_reg(UINT r);
/* overwritten */
virtual bool compare_eq(sym_int_token *t);
virtual object *duplicate();
virtual bool evaluate(bool *i);
virtual int nstrfy(char *buf, int n);
virtual OBJECT_ID object_id();
};
/*
* CLASS sym_int_mem
*/
class sym_int_mem: public sym_int_token {
public:
sym_int *addr;
UINT size;
srt_endian endian;
sym_int_mem(sym_int *a, UINT s, srt_endian e);
/* overwritten */
virtual bool compare_eq(sym_int_token *t);
virtual object *duplicate();
virtual bool evaluate(bool *i);
virtual int nstrfy(char *buf, int n);
virtual OBJECT_ID object_id();
};
/***/
char *srt_endian_to_str(srt_endian endian);
void test_srt(analyser *analy, ADDR addr);
#endif /* __SRT_H__ */
|