You can count the cycles ...That is without optimisation which will usually make code somewhat shorter.
Code:
uint32_t GpioRegisterAccess(void) { uint32_t in = GPIO_IN; GPIO_OUT = 0x12345678; return in;}Code:
2000146c <GpioRegisterAccess>:2000146c: b580 push {r7, lr}2000146e: b082 sub sp, #820001470: af00 add r7, sp, #020001472: 4b05 ldr r3, [pc, #20] ; (20001488 <GpioRegisterAccess+0x1c>)20001474: 681b ldr r3, [r3, #0]20001476: 607b str r3, [r7, #4]20001478: 4b04 ldr r3, [pc, #16] ; (2000148c <GpioRegisterAccess+0x20>)2000147a: 4a05 ldr r2, [pc, #20] ; (20001490 <GpioRegisterAccess+0x24>)2000147c: 601a str r2, [r3, #0]2000147e: 687b ldr r3, [r7, #4]20001480: 0018 movs r0, r320001482: 46bd mov sp, r720001484: b002 add sp, #820001486: bd80 pop {r7, pc}20001488: d0000004 .word 0xd00000042000148c: d0000010 .word 0xd000001020001490: 12345678 .word 0x12345678Statistics: Posted by hippy — Tue Nov 18, 2025 9:06 pm