From 155fdc74d5864266441887d6c88111159f401a62 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 9 Dec 2016 22:50:58 +1100 Subject: py/asm: Remove need for dummy_data when doing initial assembler passes. For all but the last pass the assembler only needs to count how much space is needed for the machine code, it doesn't actually need to emit anything. The dummy_data just uses unnecessary RAM and without it the code is not any more complex (and code size does not increase for Thumb and Xtensa archs). --- py/asmarm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'py/asmarm.c') diff --git a/py/asmarm.c b/py/asmarm.c index 663f86156..63963d2c0 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -55,7 +55,10 @@ void asm_arm_end_pass(asm_arm_t *as) { // Insert word into instruction flow STATIC void emit(asm_arm_t *as, uint op) { - *(uint*)asm_arm_get_cur_to_write_bytes(as, 4) = op; + uint8_t *c = mp_asm_base_get_cur_to_write_bytes(&as->base, 4); + if (c != NULL) { + *(uint32_t*)c = op; + } } // Insert word into instruction flow, add "ALWAYS" condition code -- cgit v1.2.3