2024-10-21 08:12:37 -05:00
|
|
|
example:
|
|
|
|
ADDI64 r254, r254, -8d
|
|
|
|
ST r31, r254, 0a, 8h
|
|
|
|
LI64 r3, 768d
|
|
|
|
LI64 r2, 0d
|
|
|
|
JAL r31, r0, :integer
|
|
|
|
LD r31, r254, 0a, 8h
|
|
|
|
ADDI64 r254, r254, 8d
|
|
|
|
JALA r0, r31, 0a
|
|
|
|
integer:
|
|
|
|
LI64 r6, 0d
|
|
|
|
LI64 r1, 4d
|
|
|
|
JNE r3, r6, :0
|
|
|
|
SUB64 r10, r3, r2
|
|
|
|
ADDI64 r12, r10, 1d
|
|
|
|
DIRS64 r0, r3, r1, r12
|
|
|
|
ADD64 r1, r3, r2
|
|
|
|
JMP :0
|
|
|
|
0: JALA r0, r31, 0a
|
|
|
|
line:
|
2024-10-23 05:26:07 -05:00
|
|
|
ADDI64 r254, r254, -48d
|
|
|
|
ST r2, r254, 32a, 16h
|
|
|
|
ADDI64 r2, r254, 32d
|
|
|
|
ST r4, r254, 16a, 16h
|
|
|
|
ADDI64 r4, r254, 16d
|
2024-10-21 08:12:37 -05:00
|
|
|
ST r6, r254, 0a, 16h
|
|
|
|
ADDI64 r6, r254, 0d
|
|
|
|
LD r9, r4, 0a, 8h
|
|
|
|
LD r11, r2, 0a, 8h
|
2024-10-22 00:20:08 -05:00
|
|
|
JGTS r11, r9, :0
|
2024-10-21 08:12:37 -05:00
|
|
|
JMP :0
|
2024-10-23 05:26:07 -05:00
|
|
|
0: ADDI64 r254, r254, 48d
|
|
|
|
JALA r0, r31, 0a
|
2024-10-21 08:12:37 -05:00
|
|
|
main:
|
2024-10-22 03:08:50 -05:00
|
|
|
ADDI64 r254, r254, -184d
|
|
|
|
ST r31, r254, 96a, 88h
|
2024-10-21 08:12:37 -05:00
|
|
|
LI64 r32, 10d
|
2024-10-22 03:08:50 -05:00
|
|
|
LI64 r33, 0d
|
|
|
|
ADDI64 r34, r254, 48d
|
|
|
|
ADDI64 r35, r254, 64d
|
|
|
|
ADDI64 r36, r254, 80d
|
|
|
|
LD r37, r254, 96a, 0h
|
|
|
|
ST r33, r254, 80a, 8h
|
|
|
|
ST r33, r254, 88a, 8h
|
|
|
|
ST r33, r254, 64a, 8h
|
|
|
|
ST r33, r254, 72a, 8h
|
|
|
|
ST r33, r254, 48a, 8h
|
|
|
|
ST r33, r254, 56a, 8h
|
2024-10-21 08:12:37 -05:00
|
|
|
CP r8, r32
|
2024-10-22 03:08:50 -05:00
|
|
|
LD r2, r36, 0a, 16h
|
|
|
|
LD r4, r35, 0a, 16h
|
|
|
|
LD r6, r34, 0a, 16h
|
2024-10-21 08:12:37 -05:00
|
|
|
JAL r31, r0, :line
|
2024-10-22 03:08:50 -05:00
|
|
|
ADDI64 r38, r254, 0d
|
|
|
|
ADDI64 r39, r254, 16d
|
|
|
|
ADDI64 r40, r254, 32d
|
|
|
|
LD r41, r254, 48a, 0h
|
|
|
|
ST r33, r254, 32a, 8h
|
|
|
|
ST r33, r254, 40a, 8h
|
|
|
|
ST r33, r254, 16a, 8h
|
|
|
|
ST r33, r254, 24a, 8h
|
|
|
|
ST r33, r254, 0a, 8h
|
|
|
|
ST r33, r254, 8a, 8h
|
2024-10-21 08:12:37 -05:00
|
|
|
CP r8, r32
|
2024-10-22 03:08:50 -05:00
|
|
|
LD r2, r40, 0a, 16h
|
|
|
|
LD r4, r39, 0a, 16h
|
|
|
|
LD r6, r38, 0a, 16h
|
2024-10-21 08:12:37 -05:00
|
|
|
JAL r31, r0, :rect_line
|
|
|
|
JAL r31, r0, :example
|
2024-10-22 03:08:50 -05:00
|
|
|
CP r1, r33
|
|
|
|
LD r31, r254, 96a, 88h
|
|
|
|
ADDI64 r254, r254, 184d
|
2024-10-21 08:12:37 -05:00
|
|
|
JALA r0, r31, 0a
|
|
|
|
rect_line:
|
2024-10-23 05:26:07 -05:00
|
|
|
ADDI64 r254, r254, -48d
|
|
|
|
ST r2, r254, 32a, 16h
|
|
|
|
ADDI64 r2, r254, 32d
|
|
|
|
ST r4, r254, 16a, 16h
|
|
|
|
ADDI64 r4, r254, 16d
|
2024-10-21 08:12:37 -05:00
|
|
|
ST r6, r254, 0a, 16h
|
|
|
|
ADDI64 r6, r254, 0d
|
|
|
|
LI64 r10, 0d
|
|
|
|
LD r12, r2, 8a, 8h
|
|
|
|
LD r4, r4, 0a, 8h
|
|
|
|
ADD64 r6, r4, r12
|
|
|
|
3: JNE r10, r8, :0
|
|
|
|
JMP :1
|
|
|
|
0: CP r9, r12
|
|
|
|
4: JNE r6, r9, :2
|
|
|
|
ADDI64 r10, r10, 1d
|
|
|
|
JMP :3
|
|
|
|
2: ADDI64 r9, r9, 1d
|
|
|
|
JMP :4
|
2024-10-23 05:26:07 -05:00
|
|
|
1: ADDI64 r254, r254, 48d
|
|
|
|
JALA r0, r31, 0a
|
|
|
|
code size: 930
|
2024-10-22 03:08:50 -05:00
|
|
|
ret: 0
|
2024-10-21 08:12:37 -05:00
|
|
|
status: Ok(())
|