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-21 12:57:55 -05:00
|
|
|
ADDI64 r254, r254, -160d
|
|
|
|
ST r31, r254, 96a, 64h
|
2024-10-21 08:12:37 -05:00
|
|
|
LI64 r32, 10d
|
|
|
|
LI64 r1, 0d
|
2024-10-21 12:57:55 -05:00
|
|
|
ADDI64 r33, r254, 48d
|
|
|
|
ADDI64 r34, r254, 64d
|
|
|
|
ADDI64 r35, r254, 80d
|
2024-10-21 08:12:37 -05:00
|
|
|
ST r1, r254, 80a, 8h
|
|
|
|
ST r1, r254, 88a, 8h
|
|
|
|
ST r1, r254, 64a, 8h
|
|
|
|
ST r1, r254, 72a, 8h
|
|
|
|
ST r1, r254, 48a, 8h
|
|
|
|
ST r1, r254, 56a, 8h
|
|
|
|
CP r8, r32
|
2024-10-21 12:57:55 -05:00
|
|
|
LD r2, r35, 0a, 16h
|
|
|
|
LD r4, r34, 0a, 16h
|
|
|
|
LD r6, r33, 0a, 16h
|
2024-10-21 08:12:37 -05:00
|
|
|
JAL r31, r0, :line
|
2024-10-21 12:57:55 -05:00
|
|
|
ADDI64 r36, r254, 0d
|
|
|
|
ADDI64 r37, r254, 16d
|
|
|
|
ADDI64 r38, r254, 32d
|
2024-10-21 08:12:37 -05:00
|
|
|
ST r1, r254, 32a, 8h
|
|
|
|
ST r1, r254, 40a, 8h
|
|
|
|
ST r1, r254, 16a, 8h
|
|
|
|
ST r1, r254, 24a, 8h
|
|
|
|
ST r1, r254, 0a, 8h
|
|
|
|
ST r1, r254, 8a, 8h
|
|
|
|
CP r8, r32
|
2024-10-21 12:57:55 -05:00
|
|
|
LD r2, r38, 0a, 16h
|
|
|
|
LD r4, r37, 0a, 16h
|
|
|
|
LD r6, r36, 0a, 16h
|
2024-10-21 08:12:37 -05:00
|
|
|
JAL r31, r0, :rect_line
|
|
|
|
JAL r31, r0, :example
|
2024-10-21 12:57:55 -05:00
|
|
|
LD r31, r254, 96a, 64h
|
|
|
|
ADDI64 r254, r254, 160d
|
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-21 12:57:55 -05:00
|
|
|
code size: 857
|
2024-10-21 10:04:29 -05:00
|
|
|
ret: 4
|
2024-10-21 08:12:37 -05:00
|
|
|
status: Ok(())
|