spo/ass1/Rekurzija/cstack.asm

28 lines
No EOL
495 B
NASM

cstk EXTDEF sinit, spush, spop, stkp
sinit STA stkA
LDA #stk
STA stkp
LDA stkA
RSUB
spush . stkp++
STA stkA
LDA stkp
ADD #3
STA stkp
LDA stkA
RSUB
spop . stkp--
STA stkA
LDA stkp
SUB #3
STA stkp
LDA stkA
RSUB
stkp WORD 0
stk RESW 1000
stkA WORD 0
END cstk