28 lines
578 B
NASM
Raw Permalink Normal View History

2022-04-07 18:43:21 +02:00
#set_pixel:
# #a0=x, a1=y
# addi t0, zero, LEDS #t0 : led adress
# addi t1, a0, 0 #t1 : counter of x led index
# addi t2, zero, 0 #t2 : LED word
# addi t3, zero, 1 #t3 : pixel
# addi t4, zero, 0 #t4 : counter of x led words
# addi t5, zero, 0 #t5 : counter of x pos in word
# addi t7, zero, 8 #t7 : 8, x shift of byte
#get_pixel_address:
# addi t5, t1, 0
# addi t1, t1, -4
# addi t4, t4, 4
# bge t1, zero, get_pixel_address
#
# addi t4, t4, -4
# add t0, t0, t4
# ldw t2, 0 (t0)
#
# slli t7, t5, 3
# add t7, t7, a1
# sll t3, t3, t7
# or t2, t2, t3
#
# stw t2, 0 (t0)
# ret