holey-bytes/lang/tests/son_tests_fb_driver.txt

54 lines
992 B
Plaintext

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
main:
ADDI64 r254, r254, -64d
ST r31, r254, 0a, 64h
JAL r31, r0, :check_platform
LI64 r32, 0d
LI64 r33, 30d
LI64 r34, 100d
CP r35, r32
CP r36, r32
CP r37, r32
5: JLTU r35, r33, :0
ADDI64 r36, r36, 1d
CP r2, r32
CP r3, r36
CP r4, r33
JAL r31, r0, :set_pixel
JEQ r1, r37, :1
CP r1, r32
JMP :2
1: CP r38, r32
JNE r36, r34, :3
CP r1, r37
JMP :2
3: CP r1, r37
CP r35, r38
JMP :4
0: CP r1, r37
CP r38, r32
ADDI64 r1, r1, 1d
ADDI64 r35, r35, 1d
4: CP r32, r38
CP r37, r1
JMP :5
2: LD r31, r254, 0a, 64h
ADDI64 r254, r254, 64d
JALA r0, r31, 0a
set_pixel:
MUL64 r8, r4, r3
ADD64 r1, r8, r2
JALA r0, r31, 0a
x86_fb_ptr:
LI64 r1, 100d
JALA r0, r31, 0a
code size: 330
ret: 3000
status: Ok(())