Hacker Newsnew | past | comments | ask | show | jobs | submit | Majster's commentslogin

Could you provide some links or examples? I'd love to learn more about this.


For kernel/OS functions, there are lots of things that can only be done while in 'kernel-mode' with kernel privileges. These are things such as turning interrupts on and off, changing which page table is being used, changing the GDT/IDT, and other various things. C has no concept of these things, and they are very special purpose. The AES instructions are similar - C has no built-in AES functionality, and the compiler just can't figure-out in which situations it could use them. All of these instructions can be accesses through inline assembly, so you can still use them in C, the compiler just won't understand what you're doing besides "It takes in these inputs, does something, and then puts out these outputs".

As for `lea`, there's nothing particularly special about it. x86 allows you to do some 'funny' addressing within instructions that take memory addresses - where you can do several calculations on the address within the instruction itself, without having to use a temporary to hold the address. `lea` just lets you 'load' the result of that calculation back into a register, presumably to let you avoid making the CPU do the calculation a bunch of times in a row. But there's nothing about `lea` that requires you to actually use addresses, rather then just plain numbers you want to shift and add. It is used a lot because `lea` is a single instruction and will generally run faster then doing a shift and some additions over multiple instructions.


Just read the output of your compiler for simple functions. objdump -d, or, cc -S


objdump -S does the trick too, it even has the C code intermixed if the -g CFLAG was used.



Can you be a bit more specific? You mean how long a NAND gates takes to "execute" a NAND operation? It's somewhere around 20 nano seconds.


20ns corresponds to 50 MHz. Recent CPUs run at over 1 GHz, so 20ns is completely off. And the clock frequency includes many gates on its critical path.


Yes, your version of the question matches what I'm seeking. 20 nano seconds. Thank you!


Shameless self promotion on HN.


Self promotion is allowed if the post is interesting, but it' very strange that this post get 9 upvotes ...

Anyway, some feedback to the OP: I watched the video and I was clueless about what this does. I read the about page, and it' not very clear, it looks like something between chat and Tweeter. Is this correct? Why is this better than Tweeter?


Thank you! If you have any additional questions let me know.


Could I track my Android app the same way?


Yes, as mentioned in the article Databox also has a Google Play developer console integration from where we pull similar data. Go ahead and try it out =)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: