3 ms·
He calls it a C trick but the actual trick is implemented in asm. It would be a cool trick if he did it purely in C. Especially today, "all the world's not x86"
by hyc_symas 12y ago
He calls it a C trick but the actual trick is implemented in asm. It would be a cool trick if he did it purely in C. Especially today, "all the world's not x86".
(And I used to be a gcc maintainer for m68k and i860. I'm quite familiar with frame pointers and their non-use.)
Btw: you can do this trick without resorting to assembly - start by taking the address of a local variable.
- webkike 12y agoThat depends entirely on the calling convention - potentially you can take two words down from the first argument, but that is no guarantee, and would not suffice for the didactic goals this article attempts to accomplish.