Permalink
Browse files

target-rl78: Implement MOV !addr16,#byte

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
  • Loading branch information...
1 parent d752c73 commit 033724c6df16ff7fc3261cb03085506950813651 @afaerber committed Nov 24, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 target-78k0/translate.c
View
@@ -67,7 +67,23 @@ void cpu_rl78_translate_init(void)
typedef int (*OpcodeHandler)(RL78CPU *cpu, uint8_t opcode, DisasContext *s);
+/* MOV !addr16,#byte */
+static int rl78_disas_mov_addr16_byte(RL78CPU *cpu, uint8_t opcode, DisasContext *s)
+{
+ uint16_t addr16 = cpu_lduw_code(&cpu->env, s->pc + 1);
+ uint8_t data = cpu_ldub_code(&cpu->env, s->pc + 3);
+ TCGv addr = tcg_const_tl(0xF0000 | addr16);
+ TCGv value = tcg_const_tl(data);
+
+ LOG_ASM("MOV !%04" PRIx16 "H, #%02" PRIx8 "\n", addr16, data);
+ tcg_gen_qemu_st8(value, addr, 0);
+ tcg_temp_free(addr);
+ tcg_temp_free(value);
+ return 4;
+}
+
static const OpcodeHandler rl78_1st_map[256] = {
+ [0xCF] = rl78_disas_mov_addr16_byte,
};
static void disas_rl78_insn(RL78CPU *cpu, DisasContext *s)

0 comments on commit 033724c

Please sign in to comment.