Stack Instructions

These instructions allow function calls to be implemented. They'll be covered in a subsequent lecture.
CALL k1001 010k kkkk 111k
kkkk kkkk kkkk kkkk
SRAM[SP:SP-1] = PC;SP = SP - 2; PC = k
ICALL1001 0100 0000 1001SRAM[SP:SP-1] = PC;SP = SP - 2; PC = R31:R30
RET1001 0101 0000 1000SP = SP + 2;PC = SRAM[SP:SP+1]
POP Rd1001 000d dddd 1111SP = SP + 1;Rd = SRAM[SP]
PUSH Rd1001 001d dddd 1111SRAM[SP] = Rd; SP = SP - 1

Index