Renamed vaja1 to ass1

This commit is contained in:
Timon 2025-10-26 15:17:13 +01:00
parent f74d0d09b8
commit 86af0d53f8
12 changed files with 0 additions and 0 deletions

45
ass1/Aritmetika/arith.asm Normal file
View file

@ -0,0 +1,45 @@
.aritmetika z enostavnim naslavljanjem
aritmetika START 0
program
.Sestejemo x in y
LDA x
ADD y
STA sum
.Odstejemo x in y
LDA x
SUB y
STA diff
.Zmnozimo x in y
LDA x
MUL y
STA prod
.Zdelimo x z y
LDA x
DIV y
STA quot
.Izracunamo ostanek pri deljenju x z y
LDA quot
MUL y
STA temp
LDA x
SUB temp
STA mod
halt J halt
temp RESW 1
sum RESW 1
diff RESW 1
prod RESW 1
quot RESW 1
mod RESW 1
x WORD 10
y WORD 20
END program

View file

View file

View file

View file

@ -0,0 +1,43 @@
a_rel START 0
program
. Sestejemo x in y
LDS x
LDT y
ADDR S, A
ADDR T, A
STA sum
. Odstejemo x in y
LDA S
SUBR T, A
STA diff
. Zmnozimo x in y
LDA S
MULR T, A
STA prod
. Zdelimo x in y
LDA S
DIVR T, A
STA quot
. Ostanek pri deljenju x z y
LDA quot
MULR T, A
SUBR A, S
STS mod
halt J halt
sum RESW 1
diff RESW 1
quot RESW 1
prod RESW 1
mod RESW 1
x WORD 20
y WORD 10
END program

View file

@ -0,0 +1,21 @@
***** Section <default> *****
Stats: size=77 blocks=77 symbols=10 literals=0 relocations=0
Blocks
name start size #ins #dir #sto
<default> 00000 0004D 22 4 5
Symbols
name hex dec scope kind type description
a_rel 000000 0 exported relative code label
diff 00003B 59 local relative data label
halt 000035 53 local relative code label
mod 000044 68 local relative data label
prod 000041 65 local relative data label
program 000000 0 local relative code label
quot 00003E 62 local relative data label
sum 000038 56 local relative data label
x 000047 71 local relative data label
y 00004A 74 local relative data label
Literals
label definition
Relocations
address length flag symbol

View file

@ -0,0 +1,44 @@
00000 a_rel START 0
00000 6F2044 program LDS x
00003 772044 LDT y
00006 9040 ADDR S,A
00008 9050 ADDR T,A
0000A 0F202B STA sum
0000D 010000 LDA #0 . Reset A-ja
. Odstejemo x in y
00010 9040 ADDR S,A
00012 9450 SUBR T,A
00014 0F2024 STA diff
00017 010000 LDA #0
. Zmnozimo x in y
0001A 9040 ADDR S,A
0001C 9850 MULR T,A
0001E 0F2020 STA prod
00021 010000 LDA #0
. Zdelimo x in y
00024 9040 ADDR S,A
00026 9C50 DIVR T,A
00028 0F2013 STA quot
. Ostanek pri deljenju x z y
0002B 6B2010 LDB quot
0002E 9853 MULR T,B
00030 9434 SUBR B,S
00032 7F200F STS mod
00035 3F2FFD halt J halt
00038 000000 sum RESW 1
0003B 000000 diff RESW 1
0003E 000000 quot RESW 1
00041 000000 prod RESW 1
00044 000000 mod RESW 1
00047 000014 x WORD 20
0004A 00000A y WORD 10
0004D END program

View file

@ -0,0 +1,5 @@
Ha_rel 00000000004D
T0000001E6F2044772044904090500F202B010000904094500F202401000090409850
T00001E1A0F202001000090409C500F20136B2010985394347F200F3F2FFD
T0000470600001400000A
E000000

49
ass1/Polinom/poly.asm Normal file
View file

@ -0,0 +1,49 @@
. Racunanje polinoma klasicno
p START 0
racunanje
. Prosti člen
LDA a0
. Linearni člen (T = x¹)
LDT x
LDB x
LDS a1
MULR T, S
ADDR S, A
. Kvadratni člen (T = x²)
LDS a2
MULR B, T
MULR T, S
ADDR S, A
. Kubicni člen (T = x³)
LDS a3
MULR B, T
MULR T, S
ADDR S, A
. T = x
LDS a4
MULR B, T
MULR T, S
ADDR S, A
STA poly
halt J halt
END racunanje
. Tocka
x WORD 2
. Rezultat
poly RESW 1
. Koeficienti
a0 WORD 5
a1 WORD 4
a2 WORD 3
a3 WORD 2
a4 WORD 1

21
ass1/Polinom/poly.log Normal file
View file

@ -0,0 +1,21 @@
***** Section <default> *****
Stats: size=70 blocks=70 symbols=10 literals=0 relocations=0
Blocks
name start size #ins #dir #sto
<default> 00000 00046 20 8 1
Symbols
name hex dec scope kind type description
a0 000037 55 local relative data label
a1 00003A 58 local relative data label
a2 00003D 61 local relative data label
a3 000040 64 local relative data label
a4 000043 67 local relative data label
halt 00002E 46 local relative code label
p 000000 0 exported relative code label
poly 000034 52 local relative data label
racunanje 000000 0 local relative code label
x 000031 49 local relative data label
Literals
label definition
Relocations
address length flag symbol

47
ass1/Polinom/poly.lst Normal file
View file

@ -0,0 +1,47 @@
. Racunanje polinoma klasicno
00000 p START 0
00000 032034 racunanje LDA a0
. Linearni člen (T = x¹)
00003 77202B LDT x
00006 6B2028 LDB x
00009 6F202E LDS a1
0000C 9854 MULR T,S
0000E 9040 ADDR S,A
. Kvadratni člen (T = x²)
00010 6F202A LDS a2
00013 9835 MULR B,T
00015 9854 MULR T,S
00017 9040 ADDR S,A
. Kubicni člen (T = x³)
00019 6F2024 LDS a3
0001C 9835 MULR B,T
0001E 9854 MULR T,S
00020 9040 ADDR S,A
. T = x⁴
00022 6F201E LDS a4
00025 9835 MULR B,T
00027 9854 MULR T,S
00029 9040 ADDR S,A
0002B 0F2006 STA poly
0002E 3F2FFD halt J halt
00031 END racunanje
. Tocka
00031 000002 x WORD 2
. Rezultat
00034 000000 poly RESW 1
. Koeficienti
00037 000005 a0 WORD 5
0003A 000004 a1 WORD 4
0003D 000003 a2 WORD 3
00040 000002 a3 WORD 2
00043 000001 a4 WORD 1

5
ass1/Polinom/poly.obj Normal file
View file

@ -0,0 +1,5 @@
Hp 000000000046
T0000001E03203477202B6B20286F202E985490406F202A9835985490406F20249835
T00001E16985490406F201E9835985490400F20063F2FFD000002
T0000370F000005000004000003000002000001
E000000