# Code\_native opcode annotations

**URL:** <https://discourse.julialang.org/t/code-native-opcode-annotations/29562>\
**Category:** General Usage\
**Created:** [October 6, 2019, 7:41pm UTC](https://discourse.julialang.org/t/code-native-opcode-annotations/29562 "2019-10-06T19:41:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)\
**Post date:** [October 7, 2019, 1:16am UTC](https://discourse.julialang.org/t/code-native-opcode-annotations/29562/3 "2019-10-07T01:16:19Z")

</div>

This feature is more aimed towards folks who are just beginning to peek at the assembly output out of curiosity, rather than the experts who are already familliar with most of the mnemonics.

For example in this thread, an embedded reference on operand order could have saved a bunch of time and effort.

> [@Understanding generated assembly for simple loop](https://discourse.julialang.org/t/understanding-generated-assembly-for-simple-loop/9698):
>
> I am trying to understand how simple julia functions are converted into assembly. In this case, I am interested in summing the integer serie up to some argument: function foo(n) res = zero(n) for i ∈ 1:n res+=i end end Calling: julia\> code\_native(foo,(Int64,),:intel) the result is .text Filename: REPL[12] push rbp mov rbp, rsp xor eax, eax Source line: 3 test rdi, rdi jle L32 lea rax, [rdi - 1] lea rcx, [rdi - 2] mul r…

But yes, this could be an external tool. It just seems straightforward enough to offer within Julia though an additional flag.

Good point about looking at the llvm output. I previously assumed that the llvm code is further refined before becoming machine code, but I now see the optimized form is displayed by default.

---

_[View the full topic](https://discourse.julialang.org/t/code-native-opcode-annotations/29562)._
