Permalink
Browse files

target-rl78: Prepare PSW

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
  • Loading branch information...
1 parent f36105b commit a5383a96684b5267fddfbe4a5af247f03a94acd4 @afaerber committed Nov 28, 2011
Showing with 6 additions and 0 deletions.
  1. +3 −0 target-78k0/cpu.c
  2. +3 −0 target-78k0/translate.c
View
3 target-78k0/cpu.c
@@ -39,7 +39,10 @@ static void rl78_cpu_reset(CPUState *cs)
memset(&cpu->env, 0, offsetof(CPU78K0State, breakpoints));
#ifdef TARGET_RL78
+ cpu->env.psw = 0x06;
cpu->env.es = 0x0f;
+#else
+ cpu->env.psw = 0x02;
#endif
rom = rom_ptr(0x00000);
View
3 target-78k0/translate.c
@@ -27,6 +27,7 @@
static TCGv_ptr cpu_env;
static TCGv env_pc;
+static TCGv_i32 cpu_psw;
static TCGv_i32 cpu_sp;
#ifdef TARGET_RL78
static TCGv_i32 cpu_es;
@@ -65,6 +66,7 @@ void cpu_rl78_translate_init(void)
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
env_pc = tcg_global_mem_new(TCG_AREG0, offsetof(CPU78K0State, pc), "pc");
+ cpu_psw = tcg_global_mem_new_i32(TCG_AREG0, offsetof(CPU78K0State, psw), "psw");
cpu_sp = tcg_global_mem_new_i32(TCG_AREG0, offsetof(CPU78K0State, sp), "sp");
#ifdef TARGET_RL78
cpu_es = tcg_global_mem_new_i32(TCG_AREG0, offsetof(CPU78K0State, es), "es");
@@ -297,6 +299,7 @@ void rl78_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
cpu_fprintf(f, "PC %05" PRIx32 "\n\n", cpu->env.pc);
cpu_fprintf(f, "SP %04" PRIx32 "\n", cpu->env.sp);
+ cpu_fprintf(f, "PSW %02" PRIx32 "\n", cpu->env.psw);
#ifdef TARGET_RL78
cpu_fprintf(f, "ES %02" PRIx32 "\n", cpu->env.es);
cpu_fprintf(f, "CS %02" PRIx32 "\n", cpu->env.cs);

0 comments on commit a5383a9

Please sign in to comment.