I've seen this many times, I'll be honest: I can write C, but for the life of me I don't have the slightest clue how the assembly code will look like.
I've seen this many times, I'll be honest: I can write C, but for the life of me I don't have the slightest clue how the assembly code will look like.
At one point, I probably could've looked at C and had a pretty clear idea of what the 68HC12 assembly would look like... but I've never bothered to learn x86/x64 assembly, or ARM assembly, and I've written way more C code for those architectures than I ever did for microcontrollers back in undergrad.
Compiler Explorer can help a ton. https://gcc.godbolt.org/
I recommend liberal use of Compiler Explorer to verify claims during code review.
; c = a + b
load reg1, a
load reg2, b
add reg1, reg2
store reg1, cOn x86, that could be: mov [ebx], eax add [ecx], eax
Which is an entirely separate set of operands, instructions, and addressing modes. It's still the same steps, but it's not really telling you anything.