diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-09 22:54:45 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-09 22:54:45 +1100 |
commit | 93ee6603b1a18401ae2968ee8f3012fd8b36a78c (patch) | |
tree | 17f0ac2588831e303bfce06555a8f82df964dbea /py/asmx86.c | |
parent | 155fdc74d5864266441887d6c88111159f401a62 (diff) |
py/asm: Fix x86 and ARM assemblers due to recent code refactoring.
Diffstat (limited to 'py/asmx86.c')
-rw-r--r-- | py/asmx86.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/py/asmx86.c b/py/asmx86.c index ef315bf43..dd3ad0224 100644 --- a/py/asmx86.c +++ b/py/asmx86.c @@ -232,7 +232,7 @@ void asm_x86_mov_i32_to_r32(asm_x86_t *as, int32_t src_i32, int dest_r32) { // src_i32 is stored as a full word in the code, and aligned to machine-word boundary void asm_x86_mov_i32_to_r32_aligned(asm_x86_t *as, int32_t src_i32, int dest_r32) { // mov instruction uses 1 byte for the instruction, before the i32 - while (((as->code_offset + 1) & (WORD_SIZE - 1)) != 0) { + while (((as->base.code_offset + 1) & (WORD_SIZE - 1)) != 0) { asm_x86_nop(as); } asm_x86_mov_i32_to_r32(as, src_i32, dest_r32); @@ -339,13 +339,13 @@ void asm_x86_setcc_r8(asm_x86_t *as, mp_uint_t jcc_type, int dest_r8) { } STATIC mp_uint_t get_label_dest(asm_x86_t *as, mp_uint_t label) { - assert(label < as->max_num_labels); - return as->label_offsets[label]; + assert(label < as->base.max_num_labels); + return as->base.label_offsets[label]; } void asm_x86_jmp_label(asm_x86_t *as, mp_uint_t label) { mp_uint_t dest = get_label_dest(as, label); - mp_int_t rel = dest - as->code_offset; + mp_int_t rel = dest - as->base.code_offset; if (dest != (mp_uint_t)-1 && rel < 0) { // is a backwards jump, so we know the size of the jump on the first pass // calculate rel assuming 8 bit relative jump @@ -367,7 +367,7 @@ void asm_x86_jmp_label(asm_x86_t *as, mp_uint_t label) { void asm_x86_jcc_label(asm_x86_t *as, mp_uint_t jcc_type, mp_uint_t label) { mp_uint_t dest = get_label_dest(as, label); - mp_int_t rel = dest - as->code_offset; + mp_int_t rel = dest - as->base.code_offset; if (dest != (mp_uint_t)-1 && rel < 0) { // is a backwards jump, so we know the size of the jump on the first pass // calculate rel assuming 8 bit relative jump @@ -499,7 +499,7 @@ void asm_x86_call_ind(asm_x86_t *as, void *ptr, mp_uint_t n_args, int temp_r32) // this reduces code size by 2 bytes per call, but doesn't seem to speed it up at all /* asm_x86_write_byte_1(as, OPCODE_CALL_REL32); - asm_x86_write_word32(as, ptr - (void*)(as->code_base + as->code_offset + 4)); + asm_x86_write_word32(as, ptr - (void*)(as->code_base + as->base.code_offset + 4)); */ // the caller must clean up the stack |