updating tests

This commit is contained in:
Jakub Doka 2024-11-23 15:28:27 +01:00
parent fb119bc6eb
commit cad0a828d0
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143
2 changed files with 31 additions and 30 deletions

View file

@ -10,52 +10,50 @@ main:
LI64 r32, 300d LI64 r32, 300d
CP r1, r32 CP r1, r32
JMP :1 JMP :1
0: LI64 r35, 1d 0: ST r33, r32, 0a, 8h
ST r35, r32, 0a, 8h
ST r35, r32, 8a, 8h
ST r33, r32, 0a, 8h
LD r34, r32, 0a, 8h LD r34, r32, 0a, 8h
JEQ r34, r33, :2 JEQ r34, r33, :2
LI64 r32, 200d LI64 r32, 200d
CP r1, r32 CP r1, r32
JMP :1 JMP :1
2: LI64 r36, 3d 2: LI64 r35, 3d
ST r35, r32, 0a, 8h LI64 r36, 1d
ST r35, r32, 8a, 8h ST r36, r32, 0a, 8h
ADDI64 r37, r254, 16d ST r36, r32, 8a, 8h
ST r35, r254, 16a, 8h ADDI64 r37, r254, 32d
ST r35, r254, 24a, 8h ST r36, r254, 32a, 8h
ST r35, r254, 32a, 8h ST r36, r254, 40a, 8h
ST r35, r254, 40a, 8h ST r36, r254, 48a, 8h
ST r35, r254, 48a, 8h ST r36, r254, 56a, 8h
ST r35, r254, 56a, 8h ST r36, r254, 64a, 8h
ST r36, r254, 72a, 8h
CP r32, r33 CP r32, r33
8: JNE r32, r36, :3 8: JNE r32, r35, :3
LD r32, r254, 48a, 8h LD r32, r254, 64a, 8h
JEQ r32, r33, :4 JEQ r32, r33, :4
LI64 r32, 100d LI64 r32, 100d
CP r1, r32 CP r1, r32
JMP :1 JMP :1
4: ST r33, r254, 0a, 8h 4: ST r33, r254, 0a, 8h
ST r33, r254, 8a, 8h ST r33, r254, 8a, 8h
ST r33, r254, 64a, 8h ST r33, r254, 16a, 8h
ST r33, r254, 72a, 8h ST r33, r254, 24a, 8h
ST r35, r254, 16a, 8h ST r36, r254, 32a, 8h
ST r35, r254, 24a, 8h ST r36, r254, 40a, 8h
ST r35, r254, 32a, 8h ST r36, r254, 48a, 8h
ST r35, r254, 40a, 8h ST r36, r254, 56a, 8h
ST r35, r254, 48a, 8h ST r36, r254, 64a, 8h
ST r35, r254, 56a, 8h ST r36, r254, 72a, 8h
CP r32, r33 CP r32, r33
7: LD r38, r254, 48a, 8h 7: LD r38, r254, 64a, 8h
JNE r32, r36, :5 JNE r32, r35, :5
JEQ r38, r33, :6 JEQ r38, r33, :6
LI64 r32, 10d LI64 r32, 10d
CP r1, r32 CP r1, r32
JMP :1 JMP :1
6: CP r1, r33 6: CP r1, r33
JMP :1 JMP :1
5: ADD64 r34, r32, r35 5: ADD64 r34, r32, r36
MULI64 r32, r32, 16d MULI64 r32, r32, 16d
ADD64 r32, r37, r32 ADD64 r32, r37, r32
ST r33, r32, 0a, 8h ST r33, r32, 0a, 8h
@ -66,7 +64,7 @@ main:
ADD64 r34, r37, r34 ADD64 r34, r37, r34
JAL r31, r0, :new_stru JAL r31, r0, :new_stru
ST r1, r34, 0a, 16h ST r1, r34, 0a, 16h
ADD64 r32, r32, r35 ADD64 r32, r32, r36
JMP :8 JMP :8
1: LD r31, r254, 80a, 64h 1: LD r31, r254, 80a, 64h
ADDI64 r254, r254, 144d ADDI64 r254, r254, 144d
@ -79,6 +77,6 @@ new_stru:
LD r1, r13, 0a, 16h LD r1, r13, 0a, 16h
ADDI64 r254, r254, 16d ADDI64 r254, r254, 16d
JALA r0, r31, 0a JALA r0, r31, 0a
code size: 765 code size: 739
ret: 0 ret: 0
status: Ok(()) status: Ok(())

View file

@ -10,9 +10,12 @@ add:
ADD32 r13, r13, r14 ADD32 r13, r13, r14
CP r1, r13 CP r1, r13
JALA r0, r31, 0a JALA r0, r31, 0a
add:
JALA r0, r31, 0a
main: main:
ADDI64 r254, r254, -32d ADDI64 r254, r254, -32d
ST r31, r254, 0a, 32h ST r31, r254, 0a, 32h
JAL r31, r0, :add
LI32 r32, 2w LI32 r32, 2w
CP r2, r32 CP r2, r32
CP r3, r32 CP r3, r32
@ -30,6 +33,6 @@ main:
LD r31, r254, 0a, 32h LD r31, r254, 0a, 32h
ADDI64 r254, r254, 32d ADDI64 r254, r254, 32d
JALA r0, r31, 0a JALA r0, r31, 0a
code size: 191 code size: 209
ret: 0 ret: 0
status: Ok(()) status: Ok(())