浏览代码

Fix assembler bug involving extended immediates.

master
Ben Kurtovic 8 年前
父节点
当前提交
ba701545b2
共有 3 个文件被更改,包括 5 次插入3 次删除
  1. +4
    -2
      src/assembler/instructions.c
  2. +1
    -1
      src/disassembler/mnemonics.c
  3. 二进制
     

+ 4
- 2
src/assembler/instructions.c 查看文件

@@ -92,9 +92,11 @@ static ASMErrorDesc parse_inst_##mnemonic( \
}

#define INST_IMM_U16_B1(imm) \
((imm).is_label ? (*symbol = cr_strdup((imm).label), 0) : (imm).uval >> 8)
((imm).is_label ? \
(*symbol = cr_strdup((imm).label), 0) : \
(imm).uval & 0xFF)
#define INST_IMM_U16_B2(imm) \
((imm).is_label ? 0 : (imm).uval & 0xFF)
((imm).is_label ? 0 : (imm).uval >> 8)

#define INST_INDEX_PREFIX(n) INST_PREFIX_(INST_INDEX(n).reg)



+ 1
- 1
src/disassembler/mnemonics.c 查看文件

@@ -18,7 +18,7 @@ static char* instr_mnemonics[256] = {
/* 58 */ "ld", "ld", "ld", "ld", "ld", "ld", "ld", "ld",
/* 60 */ "ld", "ld", "ld", "ld", "ld", "ld", "ld", "ld",
/* 68 */ "ld", "ld", "ld", "ld", "ld", "ld", "ld", "ld",
/* 70 */ "ld", "ld", "ld", "ld", "ld", "ld", "ld", "ld",
/* 70 */ "ld", "ld", "ld", "ld", "ld", "ld", "halt", "ld",
/* 78 */ "ld", "ld", "ld", "ld", "ld", "ld", "ld", "ld",
/* 80 */ "add", "add", "add", "add", "add", "add", "add", "add",
/* 88 */ "adc", "adc", "adc", "adc", "adc", "adc", "adc", "adc",


二进制
查看文件


正在加载...
取消
保存