News for hackers. Stuff that matters.
Re:Should you learn C to “learn how the computer works”? by tom_ on Tuesday October 02, 2018 @01:47PM (#18123950)
RISC-type architectures with a branch-and-link instruction (as opposed to a jsr- or call-type instruction) generally have a stack by convention only, because the CPU doesn't need one to operate. (For handling interrupts and exceptions there is usually some other mechanism for storing the old program counter.)
Re:Should you learn C to “learn how the computer works”? by hfdgiutdryg on Tuesday October 02, 2018 @02:01PM (#18124092)
Can you point me to a RISC architecture that doesn't have push and pop instructions?
Re:Should you learn C to “learn how the computer works”? by monocasa on Tuesday October 02, 2018 @02:19PM (#18124250)
Nearly all of them?

ARM's pop is really a generic ldmia with update. You can use the same instruction in a memcpy.

MIPS, PowerPC, and Alpha don't have anything like push and pop, splitting load/stores and SP increment/decrement into separate instructions.

AArch64 has a dedicated stack pointer, but no explicit push pop.

In general the RISC style is to allocate a stack frame and use regular loads and stores off of SP rather than push and pop.

Re:Should you learn C to “learn how the computer works”? by swolchok on Tuesday October 02, 2018 @02:07PM (#18124148)
ARM64 uses regular loads and stores to access the stack, I believe. It also is one of the architectures with branch-and-link. https://community.arm.com/processors/b/blog/posts/using-the-...