holey-bytes/lang/tests/son_tests_fb_driver.txt
2024-10-25 14:51:33 +02:00

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