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:
|
|
|
|
ST r2, r254, 0a, 16h
|
|
|
|
ADDI64 r2, r254, 0d
|
|
|
|
ST r4, r254, 0a, 16h
|
|
|
|
ADDI64 r4, r254, 0d
|
|
|
|
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
|
|
|
|
0: JALA r0, r31, 0a
|
|
|
|
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:
|
|
|
|
ST r2, r254, 0a, 16h
|
|
|
|
ADDI64 r2, r254, 0d
|
|
|
|
ST r4, r254, 0a, 16h
|
|
|
|
ADDI64 r4, r254, 0d
|
|
|
|
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
|
|
|
|
1: JALA r0, r31, 0a
|
2024-10-22 03:08:50 -05:00
|
|
|
code size: 886
|
|
|
|
ret: 0
|
2024-10-21 08:12:37 -05:00
|
|
|
status: Ok(())
|