Hacker News new | ask | show | jobs
by 3xblah 2369 days ago
I read that line as suggesting that when using HLL the programmer generally does not have control over the assembly that is generated. I guess that is why sometimes, as the author suggests, the programmer may write part of a program in HLL and another part in assembly in order to achieve increase execution speed.
1 comments

It's more than just execution speed. It could something as simple making a function using assembly that swaps the virtual memory page table on a processor. That's not something you gonna find in a high level language.
Yup. The example I implemented in college is stack pointer manipulation to implement multithreading (think pthread).

Some things can only be done in assembly.

Yea done that myself, save all the register states, save the stack pointer, and then set a new stack pointer and load all that tasks register states.

Although doing the same on windows is kinda annoying. Also the amount callee saved registers is kinda like what the heck. Here is some code I wrote doing that for window's ABI. https://pastebin.com/jnxeMRcV