TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Online C/C++ to assembly visualizer [Weekend Project]

149 pointsby ynhover 12 years ago

20 comments

muninover 12 years ago
LLVM has a similar page: <a href="http://llvm.org/demo" rel="nofollow">http://llvm.org/demo</a><p>you can compile C/C++ to LLVM IR and also 32 or 64 bit intel assembler. you can also see the effects of different optimizations, etc
berkutover 12 years ago
Side by side would be a better layout like: <a href="http://gcc.godbolt.org/" rel="nofollow">http://gcc.godbolt.org/</a>
option_greekover 12 years ago
Nice project. Will be more useful if there is an explanation of code generated. For example, making the various assembly instructions clickable and displaying information about them. Also a tiny bit of explanation about code and data sections might be of help too :)
评论 #4560509 未加载
评论 #4560531 未加载
winter_blueover 12 years ago
This could be a great educational tool! It could be used to teach Introductory Computer Organization at the college level.<p>I have a suggestion:<p>- Would you be able to separate the web interface, so that it could used to display Java -&#62; JVM assembly, or any other language. Basically, so that it would be re-usable.<p>- Putting this up on GitHub would be great.<p>Finally, great work for just a weekend!
评论 #4560645 未加载
unix-dudeover 12 years ago
Definitely interesting! Lots of us unix people would just run objdump -d for a quick ASM extraction, but this is probably much friendlier to the user just starting to learn C/ASM.<p>Overall, Good Job!
jrajavover 12 years ago
Silently fails if you make a syntax error. I accidentally pasted this without newlines and at first I thought it wasn't responding:<p><pre><code> #include &#60;stdio.h&#62;int main() { printf("Hello World"); }</code></pre>
mappuover 12 years ago
Can i recommend adding -masm=intel to your gcc flags? I know AT&#38;T syntax is the default for gcc and gas, but not why. Intel syntax seems clearer to read and is used by most assembly tutorials.
评论 #4560646 未加载
vvnramanover 12 years ago
This really removes any hurdle I might have of inspecting the assembly code due to sheer laziness of opening up my Visual Studio and start debugging. Awesome work. If you add some type of interactivity to the generated assembly, it can be made more visual.
b3b0pover 12 years ago
I love it!<p>My only suggestion right now is to have it so you can have the assembly on the left or right side. Maybe it's just me, but my focus seems to be on the left side more than the right.<p>Since this is a focused on assembly it seems, wouldn't you want the focus on the assembly, not the C? It could be different for different people though.
Aardwolfover 12 years ago
In the hello world example, no matter what text you put there, the assembly is the same. Where does the string content go?
评论 #4561349 未加载
tismeover 12 years ago
Very neat! Suggestion: add a 'flags' field where you can specify stuff like -std=c99 and any other flags you might need for your code to compile, and a horizontal rule or something like that after every line of input code.<p>If you do the 'flags' thing make sure you filter it to avoid escapes to the underlying shell.
gtklockerover 12 years ago
Error: Command failed: /tmp/test969394043.c:1:0: fatal error: can’t open /root/assembler/ccMEBJ3B.s for writing: Permission denied compilation terminated. The bug is not reproducible, so it is likely a hardware or OS problem.<p>Really.
评论 #4560847 未加载
daurnimatorover 12 years ago
Error: Command failed: /bin/sh: 1: c-preload/compiler-wrapper: Permission denied
评论 #4560821 未加载
ajhaiover 12 years ago
Interesting project. As an improvement to the UI, you can consider adding syntax highlighting to the editor. Take a look at ACE editor (<a href="http://ace.ajax.org/" rel="nofollow">http://ace.ajax.org/</a>).
alpbover 12 years ago
Try this on iPad. Generated assembly looks very bad in terms of layout.
评论 #4560539 未加载
评论 #4560764 未加载
erichoceanover 12 years ago
It'd be nice to make, e.g. the for loop clickable, so that it "stuck" and you could scroll down and see where it ended.<p>As it is now, as soon as you move your mouse, it unhighlights.
akaviover 12 years ago
Does anyone have a link to a good beginner's guide explaining the output?
bostkoover 12 years ago
Can't you add a function for memorizing the code written?<p>Thank you!
评论 #4561512 未加载
jherikoover 12 years ago
don't work really - some guidance on use might be acceptable. does it need to be a whole program? my snippets give confusing errors about variable identifiers not being types o_0
评论 #4562027 未加载
pgbovineover 12 years ago
excellent -- my unsolicited advice is for you to ping some professors and TAs who teach low-level programming to get them interested in using this in their teaching.