old-cross-binutils/sim/tic80/alu.h
Andrew Cagney d9b7594738 o Add core and event objects into simulator
base type
o	Add preliminary tracing support for same
o	trace_printf() takes both SD and CPU arguments
o	Add CIA to standard set of parameters for
	generated functions.
o	Pacify GCC
1997-05-02 05:31:34 +00:00

40 lines
1 KiB
C

#ifndef _TIC80_ALU_H_
#define _TIC80_ALU_H_
#define ALU_CARRY 0 /* FIXME */
#include "sim-alu.h"
#define ALU32_END(TARG) \
{ \
(TARG) = (unsigned32)alu_carry_val; /* FIXME */ \
}}
#define ALU_END(TARG) ALU32_END(TARG)
/* Bring data in from the cold */
#define IMEM(EA) \
(sim_core_read_4(sd, sim_core_execute_map, (EA), \
STATE_CPU (sd, 0), cia))
#define MEM(SIGN, EA, NR_BYTES) \
((SIGN##_##NR_BYTES) sim_core_read_##NR_BYTES (SD, sim_core_read_map, \
(EA) & ~(NR_BYTES - 1), \
STATE_CPU (sd, 0), cia))
#define STORE(EA, NR_BYTES, VAL) \
do { \
sim_core_write_##NR_BYTES (SD, sim_core_write_map, \
(EA) & ~(NR_BYTES - 1), (VAL), \
STATE_CPU (sd, 0), cia); \
} while (0)
#define long_immediate(VARIABLE) \
unsigned_word VARIABLE = MEM (unsigned, nia.ip, 4); \
nia.ip += sizeof (instruction_word); \
nia.dp += sizeof (instruction_word);
#endif