Skip to content

Commit a4022c9

Browse files
committed
py, inline asm: Change "and" op name to "and_" to avoid keyword clash.
Addresses issue adafruit#753.
1 parent a50494a commit a4022c9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

py/emitinlinethumb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,14 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, int n_args, m
315315
uint reg_dest = get_arg_reg(emit, op_str, pn_args[0], 15);
316316
uint reg_src = get_arg_reg(emit, op_str, pn_args[1], 15);
317317
asm_thumb_mov_reg_reg(emit->as, reg_dest, reg_src);
318-
} else if (strcmp(op_str, "and") == 0) {
318+
} else if (strcmp(op_str, "and_") == 0) {
319319
op_code = ASM_THUMB_FORMAT_4_AND;
320320
uint reg_dest, reg_src;
321321
op_format_4:
322322
reg_dest = get_arg_reg(emit, op_str, pn_args[0], 7);
323323
reg_src = get_arg_reg(emit, op_str, pn_args[1], 7);
324324
asm_thumb_format_4(emit->as, op_code, reg_dest, reg_src);
325325
// TODO probably uses less ROM if these ops are in a lookup table
326-
} else if (strcmp(op_str, "and") == 0) { op_code = ASM_THUMB_FORMAT_4_AND; goto op_format_4;
327326
} else if (strcmp(op_str, "eor") == 0) { op_code = ASM_THUMB_FORMAT_4_EOR; goto op_format_4;
328327
} else if (strcmp(op_str, "lsl") == 0) { op_code = ASM_THUMB_FORMAT_4_LSL; goto op_format_4;
329328
} else if (strcmp(op_str, "lsr") == 0) { op_code = ASM_THUMB_FORMAT_4_LSR; goto op_format_4;

0 commit comments

Comments
 (0)