News for hackers. Stuff that matters.
Re:ngn/k, an AGPL K interpreter by pja on Friday January 10, 2020 @06:11AM (#22010162)
Nope :)

But http://dbp-consulting.com/tutorials/debugging/linuxProgramSt...

does suggest zeroing the top-most frame (%ebp) and making sure the stack is 16-byte aligned might also be worth doing. (Possibly it’s already 16-byte aligned already because you jmp to main instead of calling it though?)

Re:ngn/k, an AGPL K interpreter by ngnk on Friday January 10, 2020 @07:02AM (#22010376)
that's a good read, thanks. afaik zeroing %rbp here plays no role other than to assist debuggers. i'm not sure if alignment makes any measurable difference. if it does, it'll be worth doing. i jmp to main() because i wrote it and i know it never returns. it exit()-s.
Re:ngn/k, an AGPL K interpreter by saagarjha on Friday January 10, 2020 @07:06AM (#22010394)
> afaik zeroing %rbp here plays no role other than to assist debuggers.

Yep, it marks function frame boundaries. If you don't particularly care, you may want to consider compiling with -fomit-frame-pointer and the compiler will return this register back to the set of general purpose ones for it to use.

> i'm not sure if alignment makes any measurable difference. if it does, it'll be worth doing.

It will if you end up emitting any SSE instructions, because they will cause loads and stores that need to be aligned.