completed stack and fac.asm

This commit is contained in:
Jaka Furlan 2025-11-03 13:41:13 +01:00
parent d7ab158796
commit 8c8a68cb89
2 changed files with 99 additions and 0 deletions

33
ass1/stack.asm Normal file
View file

@ -0,0 +1,33 @@
prog START 0
JSUB sinit
LDT #4
STT @stkp
JSUB spush
JSUB spop
CLEAR T
LDT @stkp
halt J halt
.rutine za sklad
sinit LDA #stkRESW .inicializiraj stkp
STA stkp
RSUB
spush LDA stkp .poveca stkp za 3
ADD #3
STA stkp
RSUB
spop LDA stkp .zmanjsa stkp za 3
SUB #3
STA stkp
RSUB
.podatki za sklad
stkp WORD 0
stkRESW WORD 1000
END prog