logoalt Hacker News

mabsterlast Thursday at 7:41 AM0 repliesview on HN

I started my career in assembly and it's reduced over time. Towards the end of the gamedev work I was still reading a lot of assembly but no longer writing it (using intrinsics instead). It was definitely a lot slower to write.

But there are a number of things we did that are not available or difficult in C:

- Guaranteed tail calls

- Returning multiple values without touching memory

- using the stack pointer as a general purpose pointer for writing to memory

- Changing the stack pointer to support co-routimes

- Using our own register / calling convention (e.g. setting aside a register to be available to all routines

- Unpicking the stack to reduce register setup for commonly used routines or fast longjmps

- VM "jump tables" without requiring an indirection to know where to jump to