forked from koniifer/ableos
75 lines
1.4 KiB
Plaintext
75 lines
1.4 KiB
Plaintext
main:
|
|
ADDI64 r254, r254, -80d
|
|
ST r31, r254, 0a, 80h
|
|
JAL r31, r0, :check_platform
|
|
CP r32, r1
|
|
LI64 r33, 100d
|
|
LI64 r34, 30d
|
|
LI64 r35, 0d
|
|
LI64 r36, 0d
|
|
4: CP r37, r35
|
|
CP r38, r34
|
|
ADDI64 r38, r38, 1d
|
|
CMPS r37, r37, r38
|
|
CMPUI r37, r37, 1d
|
|
JEQ r37, r0, :0
|
|
CP r2, r35
|
|
CP r3, r36
|
|
CP r4, r33
|
|
JAL r31, r0, :set_pixel
|
|
CP r37, r1
|
|
CP r38, r35
|
|
ADDI64 r38, r38, 1d
|
|
CP r35, r38
|
|
JMP :1
|
|
0: CP r2, r35
|
|
CP r3, r36
|
|
CP r4, r33
|
|
JAL r31, r0, :set_pixel
|
|
CP r38, r1
|
|
LI64 r35, 0d
|
|
CP r39, r36
|
|
ADDI64 r39, r39, 1d
|
|
CP r36, r39
|
|
1: CP r39, r36
|
|
CP r40, r33
|
|
CMPS r39, r39, r40
|
|
CMPUI r39, r39, 0d
|
|
NOT r39, r39
|
|
JEQ r39, r0, :2
|
|
JMP :3
|
|
2: JMP :4
|
|
3: LI64 r1, 0d
|
|
LD r31, r254, 0a, 80h
|
|
ADDI64 r254, r254, 80d
|
|
JALA r0, r31, 0a
|
|
set_pixel:
|
|
ADDI64 r254, r254, -32d
|
|
ST r31, r254, 0a, 32h
|
|
CP r32, r2
|
|
CP r33, r3
|
|
CP r34, r4
|
|
MUL64 r33, r33, r34
|
|
ADD64 r33, r33, r32
|
|
LI64 r1, 0d
|
|
LD r31, r254, 0a, 32h
|
|
ADDI64 r254, r254, 32d
|
|
JALA r0, r31, 0a
|
|
check_platform:
|
|
ADDI64 r254, r254, -8d
|
|
ST r31, r254, 0a, 8h
|
|
JAL r31, r0, :x86_fb_ptr
|
|
LD r31, r254, 0a, 8h
|
|
ADDI64 r254, r254, 8d
|
|
JALA r0, r31, 0a
|
|
x86_fb_ptr:
|
|
ADDI64 r254, r254, -8d
|
|
ST r31, r254, 0a, 8h
|
|
LI64 r1, 100d
|
|
LD r31, r254, 0a, 8h
|
|
ADDI64 r254, r254, 8d
|
|
JALA r0, r31, 0a
|
|
code size: 511
|
|
ret: 0
|
|
status: Ok(())
|