diff --git a/ass1/arithr.log b/ass1/arithr.log new file mode 100644 index 0000000..2d69e88 --- /dev/null +++ b/ass1/arithr.log @@ -0,0 +1,22 @@ +***** Section ***** +Stats: size=79 blocks=79 symbols=11 literals=0 relocations=0 +Blocks + name start size #ins #dir #sto + 00000 0004F 21 4 6 +Symbols + name hex dec scope kind type description + arith 000000 0 exported relative code label + diff 000040 64 local relative data label + halt 000034 52 local relative code label + mod 000049 73 local relative data label + prod 000043 67 local relative data label + quot 000046 70 local relative data label + start 000000 0 local relative code label + sum 00003D 61 local relative data label + x 000037 55 local relative data label + y 00003A 58 local relative data label + z 00004C 76 local relative data label +Literals + label definition +Relocations + address length flag symbol diff --git a/ass1/arithr.lst b/ass1/arithr.lst new file mode 100644 index 0000000..f48f095 --- /dev/null +++ b/ass1/arithr.lst @@ -0,0 +1,46 @@ + + +00000 arith START 0 + +00000 772034 start LDT x +00003 6F2034 LDS y +00006 9054 ADDR T,S . shrani vsoto +00008 7F2032 STS sum +0000B 9454 SUBR T,S . resetiraj S nazaj na y + +0000D 9445 SUBR S,T +0000F 87202E STT diff . shrani razliko +00012 9045 ADDR S,T . popravi T + +00014 9854 MULR T,S +00016 7F202A STS prod . sharni produkt + +00019 77201B LDT x +0001C 6F201B LDS y +0001F 9C45 DIVR S,T +00021 872022 STT quot . shrani kvocient + +00024 772010 LDT x +00027 6F2010 LDS y +0002A 6B2019 LDB quot +0002D 9843 MULR S,B +0002F 9435 SUBR B,T +00031 872015 STT mod . shrani modulo + +00034 3F2FFD halt J halt +00037 END start + + . podatki +00037 000014 x WORD 20 +0003A 000003 y WORD 3 + + . rezultati +0003D 000000 sum RESW 1 +00040 000000 diff RESW 1 +00043 000000 prod RESW 1 +00046 000000 quot RESW 1 +00049 000000 mod RESW 1 + + . za modulo +0004C 000000 z RESW 1 + diff --git a/ass1/arithr.obj b/ass1/arithr.obj new file mode 100644 index 0000000..b5ab462 --- /dev/null +++ b/ass1/arithr.obj @@ -0,0 +1,5 @@ +Harith 00000000004F +T0000001E7720346F203490547F20329454944587202E904598547F202A77201B6F20 +T00001E1E1B9C458720227720106F20106B2019984394358720153F2FFD0000140000 +T00003C0103 +E000000 diff --git a/ass1/test.asm b/ass1/test.asm index 6a588f4..379ea91 100644 --- a/ass1/test.asm +++ b/ass1/test.asm @@ -1,4 +1,5 @@ poly START 0 + LDB x1 END poly x1 WORD 1 diff --git a/ass1/test.log b/ass1/test.log index 73e0a7b..478ea7b 100644 --- a/ass1/test.log +++ b/ass1/test.log @@ -1,12 +1,12 @@ ***** Section ***** -Stats: size=3 blocks=3 symbols=2 literals=0 relocations=0 +Stats: size=6 blocks=6 symbols=2 literals=0 relocations=0 Blocks name start size #ins #dir #sto - 00000 00003 0 3 0 + 00000 00006 1 3 0 Symbols name hex dec scope kind type description poly 000000 0 exported relative code label - x1 000000 0 local relative data label + x1 000003 3 local relative data label Literals label definition Relocations diff --git a/ass1/test.lst b/ass1/test.lst index ad6bbb8..81cdd8b 100644 --- a/ass1/test.lst +++ b/ass1/test.lst @@ -1,4 +1,5 @@ 00000 poly START 0 -00000 END poly +00000 6B2000 LDB x1 +00003 END poly -00000 000001 x1 WORD 1 +00003 000001 x1 WORD 1 diff --git a/ass1/test.obj b/ass1/test.obj index bbd9486..865db57 100644 --- a/ass1/test.obj +++ b/ass1/test.obj @@ -1,3 +1,3 @@ -Hpoly 000000000003 -T00000003000001 +Hpoly 000000000006 +T000000066B2000000001 E000000 diff --git a/ass2/SICocaml/sicxeDune/bin/main.ml b/ass2/SICocaml/sicxeDune/bin/main.ml index c5f24d6..b0f1d2b 100644 --- a/ass2/SICocaml/sicxeDune/bin/main.ml +++ b/ass2/SICocaml/sicxeDune/bin/main.ml @@ -8,9 +8,9 @@ let state = Processor.{regs; memory} (* Test function *) let test_runner () = let khz = 0.001 in - Processor.print_memory state 50; - Loader.load_object_file state "/mnt/c/Programiranje/SPO/ass1/horner.obj"; - Processor.print_memory state 50; + Processor.print_memory state 80; + Loader.load_object_file state "/mnt/c/Programiranje/SPO/ass1/arithr.obj"; + Processor.print_memory state 80; Printf.printf "\n\n---Starting execution!---\n\n"; Pogajalnik.run state khz diff --git a/ass2/SICocaml/sicxeDune/lib/izvajalnik.ml b/ass2/SICocaml/sicxeDune/lib/izvajalnik.ml index 288a6f8..605688e 100644 --- a/ass2/SICocaml/sicxeDune/lib/izvajalnik.ml +++ b/ass2/SICocaml/sicxeDune/lib/izvajalnik.ml @@ -195,11 +195,11 @@ let executeFormat3 (state : Processor.state) (nixbpe : nixbpe) (mnemonic: Opcode | STB -> IzvajalnikF3.stb state operand | STCH -> notImplemented "STCH4" | STF -> notImplemented "STF4" - | STL -> IzvajalnikF3.stl state operand - | STS -> IzvajalnikF3.sts state operand - | STSW -> IzvajalnikF3.stsw state operand - | STT -> IzvajalnikF3.stt state operand - | STX -> IzvajalnikF3.stx state operand + | STL -> IzvajalnikF3.stl state ea + | STS -> IzvajalnikF3.sts state ea + | STSW -> IzvajalnikF3.stsw state ea + | STT -> IzvajalnikF3.stt state ea + | STX -> IzvajalnikF3.stx state ea (* Control / IO *) | TIX -> IzvajalnikF3.tix state operand diff --git a/ass2/SICocaml/sicxeDune/lib/pogajalnik.ml b/ass2/SICocaml/sicxeDune/lib/pogajalnik.ml index 9f42d7d..8694e9d 100644 --- a/ass2/SICocaml/sicxeDune/lib/pogajalnik.ml +++ b/ass2/SICocaml/sicxeDune/lib/pogajalnik.ml @@ -10,7 +10,7 @@ let run (state : Processor.state) (khz : float) : unit = (*printni stanje*) Printf.printf "After execution:\n"; Processor.print_regs state; - Processor.print_memory state 50; + Processor.print_memory state 80; flush stdout; (*spi*)