瀏覽代碼

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",


二進制
查看文件


Loading…
取消
儲存