56 lines
1 KiB
Plaintext
56 lines
1 KiB
Plaintext
check_platform:
|
|
ADDI64 r254, r254, -16d
|
|
ST r31, r254, 0a, 16h
|
|
JAL r31, r0, :x86_fb_ptr
|
|
CP r32, r1
|
|
CP r1, r32
|
|
LD r31, r254, 0a, 16h
|
|
ADDI64 r254, r254, 16d
|
|
JALA r0, r31, 0a
|
|
main:
|
|
ADDI64 r254, r254, -56d
|
|
ST r31, r254, 0a, 56h
|
|
JAL r31, r0, :check_platform
|
|
CP r33, r0
|
|
LI64 r36, 30d
|
|
LI64 r37, 100d
|
|
CP r35, r33
|
|
CP r34, r33
|
|
CP r32, r33
|
|
5: JLTU r32, r36, :0
|
|
ADDI64 r34, r34, 1d
|
|
CP r2, r33
|
|
CP r3, r34
|
|
CP r4, r36
|
|
JAL r31, r0, :set_pixel
|
|
CP r32, r1
|
|
JEQ r32, r35, :1
|
|
CP r1, r33
|
|
JMP :2
|
|
1: JNE r34, r37, :3
|
|
CP r1, r35
|
|
JMP :2
|
|
3: CP r32, r33
|
|
JMP :4
|
|
0: ADDI64 r35, r35, 1d
|
|
ADDI64 r32, r32, 1d
|
|
4: JMP :5
|
|
2: LD r31, r254, 0a, 56h
|
|
ADDI64 r254, r254, 56d
|
|
JALA r0, r31, 0a
|
|
set_pixel:
|
|
CP r13, r2
|
|
CP r14, r3
|
|
CP r15, r4
|
|
MUL64 r14, r14, r15
|
|
ADD64 r13, r14, r13
|
|
CP r1, r13
|
|
JALA r0, r31, 0a
|
|
x86_fb_ptr:
|
|
LI64 r13, 100d
|
|
CP r1, r13
|
|
JALA r0, r31, 0a
|
|
code size: 329
|
|
ret: 3000
|
|
status: Ok(())
|