I'm making a dcpu-16 emulator and I'm having trouble implementing opcodes that use the stack pointer. What does the stack pointer point to? ram addresses?
Almost all CPU's, including DCPU-16, implements stack in memory/RAM. Stack is simply a data structure, algorithm if you will, that is useful in low level programming. The SP stack pointer is used by the PUSH, POP and PEEK values, which in turn get or put values into memory pointed to by SP.