Compare commits

...

3 commits

Author SHA1 Message Date
ddbe34f049 Merge pull request 'main' (#1) from main into master
Reviewed-on: #1
2025-11-11 17:11:39 +00:00
macabc
2e4acfb7e0 fix 2025-11-11 18:05:00 +01:00
macabc
4f4c0b92fd test2 2025-11-11 17:59:08 +01:00
13 changed files with 397 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

37
SPO/arit.asm Normal file
View file

@ -0,0 +1,37 @@
arith START 0
LDA x
ADD y
STA sum
LDA x
SUB y
STA dif
LDA x
MUL y
STA mul
LDA x
DIV y
STA dif
LDA dif
MUL y
SUB x
MUL #-1
halt J halt
.padatki
x WORD 42
y WORD 66
sum RESW 1
mul RESW 1
mod RESW 1
div RESW 1
dif RESW 1

35
SPO/arith.asm Normal file
View file

@ -0,0 +1,35 @@
arith START 0
LDA x
LDB y
ADDR A, B
STB sum
LDB y
SUBR A, B
STB dif
LDB y
MULR A, B
STB mul
LDB y
DIVR A, B
STB div
LDA y
MULR A,B
LDA x
SUBR A, B
STB mod
halt J halt
.podatki
x WORD 42
y WORD 66
.res
sum RESW 1
mul RESW 1
mod RESW 1
div RESW 1
dif RESW 1

7
SPO/cat.asm Normal file
View file

@ -0,0 +1,7 @@
hello START 0
CLEAR X
loop RD #0
WD #1
J loop

23
SPO/dodatna.asm Normal file
View file

@ -0,0 +1,23 @@
prevec START 0
J #init
kon J init
start WORD 32462
konpt WORD 1048560
pt RESW 1
init LDA #zacetek
STA pt
LDA kon
STA @konpt
loop LDA pt
COMP konpt
JEQ #zacetek
LDA start
STA @pt
MUL start
ADD start
STA start
LDA pt
ADD #3
STA pt
J loop
zacetek RESW 1

85
SPO/echo.asm Normal file
View file

@ -0,0 +1,85 @@
Hello START 0
LDA #103
JSUB num
halt J halt
nl STA olda
STB oldb
LDA #12
WD #1
LDA a
LDA olda
LDB olda
RSUB
char STA olda
STB oldb
WD #1
LDA olda
LDB olda
RSUB
string STA olda
STB oldb
loop STA a
LDCH @a
COMP #0
JEQ out
WD #1
LDA a
ADD #1
J loop
out LDA olda
LDB olda
RSUB
num LDB #stev
STB zacetek
LDX #1
loop1 STB trenutno
STA a
DIV #10
MUL #10
STA b
LDA a
SUB b
ADD #48
STCH @trenutno
ADDR X,B
LDA a
DIV #10
COMP #0
JGT loop1
loop2 LDCH @trenutno
WD #1
LDB trenutno
SUBR X,B
STB trenutno
LDA trenutno
COMP zacetek
JLT konec
J loop2
konec RSUB
.funkcise
olda RESW 1
oldb RESW 1
.data
a RESW 1
b RESW 1
c RESW 1
zacetek RESW 1
trenutno RESW 1
stev RESW 1
beseda BYTE C'UIAI'

62
SPO/fakulteta.asm Normal file
View file

@ -0,0 +1,62 @@
stack START 0
JSUB stackinit
LDA #7
JSUB fakulteta
halt J halt
fakulteta STA funtemp
RMO L,A
JSUB stackpush
LDA funtemp
JSUB stackpush
SUB #1
COMP #1
JEQ return
JSUB fakulteta
return RMO A,B
JSUB stackpop
MULR A,B
JSUB stackpop
RMO A,L
RMO B,A
RSUB
stackinit STA tempA
LDA #stack1
STA stackptr
LDA tempA
RSUB
stackpush STA tempA
STA @stackptr
LDA stackptr
ADD #3
STA stackptr
LDA tempA
RSUB
stackpop LDA stackptr
SUB #3
STA stackptr
LDA @stackptr
RSUB
.temp
funtemp RESW 1
tempA RESW 1
tempB RESW 1
.stack
stackptr RESW 1
stack1 RESW 20

14
SPO/horner.asm Normal file
View file

@ -0,0 +1,14 @@
horner START 0
LDA x
ADD #2
MUL x
ADD #3
MUL x
ADD #4
MUL x
ADD #5
halt J halt
.podatki
x WORD 2

29
SPO/poly.asm Normal file
View file

@ -0,0 +1,29 @@
poly START 0
LDA x
MUL x
MUL x
MUL x
RMO A,B
LDA x
MUL x
MUL x
MUL #2
ADDR A,B
LDA x
MUL x
MUL #3
ADDR A,B
LDA x
MUL #4
ADDR A,B
RMO B,A
ADD #5
halt J halt
.podatki
x WORD 2

18
SPO/print.asm Normal file
View file

@ -0,0 +1,18 @@
std START
zacetek CLEAR X
loop LDCH txt, X
WD #170
TIX #txtlen
JLT loop
halt J halt
.txt
txt BYTE C'SIC/EXE'
BYTE 0
txtend EQU *
txtlen EQU txtend-txt
END zacetek

46
SPO/screen.asm Normal file
View file

@ -0,0 +1,46 @@
hello START 0
LDA #40
JSUB scrclear
halt J halt
scrfill LDB screen
STB temp
STA temp2
loop LDA temp2
STCH @temp
LDA temp
ADD #1
STA temp
LDB screen
SUBR B,A
COMP scrlen
JLT loop
RSUB
scrclear LDB screen
STB temp
STA temp2
loop1 LDA #0
STCH @temp
LDA temp
ADD #1
STA temp
LDB screen
SUBR B,A
COMP scrlen
JLT loop1
RSUB
.podatki
temp RESW 1
temp1 RESW 1
temp2 RESW 1
screen WORD X'00B800'
scrcols WORD 80
scrrows WORD 25
scrlen WORD 2000

41
SPO/stack.asm Normal file
View file

@ -0,0 +1,41 @@
stack START 0
JSUB stackinit
LDA #40
JSUB stackpush
LDA #20
JSUB stackpop
halt J halt
stackinit STA tempA
LDA #stack1
STA stackptr
LDA tempA
RSUB
stackpush STA tempA
STA @stackptr
LDA stackptr
ADD #3
LDA stackptr
LDA tempA
RSUB
stackpop LDA stackptr
SUB #3
STA stackptr
LDA @stackptr
RSUB
.temp
tempA RESW 1
tempB RESW 1
.stack
stackptr RESW 1
stack1 RESW 5

0
test
View file