Find limit of recursion is part of Short Circuit's Console Program Basics selection.
Task

Find the limit of recursion.




;beginning of your program
lda #$BE
sta $0100
lda #$EF
sta $0101
 
ldx #$ff
txs      ;stack pointer is set to $FF
 
 
;later...
 
lda $0100 ;if this no longer equals $BE the stack has overflowed
cmp #$BE
bne StackHasOverflowed