Hacker Newsnew | comments | show | ask | jobs | submit login

>Starting in assembly right away would be a bit too insane, so I first wrote a reference implementation in C

How did he make the reference code? I'm reading that as he wrote an implementation in C, then decompiled it and then cleaned up the decompiled Assembly language code.

Maybe I'm wrong. How do you take his statement above?




Author here, I did look at some of the assembly output from C code, especially for frequently called functions like get_block/set_block, but other than that I used no reference but the original C code to write the assembly.

-----


He probably asked the compiler to emit the assembly it generates (e.g. gcc's -S option); disassembling or decompiling would be overkill.

-----


He COMPILED the C code into its assembly stage with a gcc option. He probably just looked at the .S file from gcc..

-----


You can also read it as, write C code, test. Repeat until you have functionality you want. Pick block of C code, replace with assembly equivalent. Repeat.

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: