+
+ ;
+ ; write font into framebuffer sram
+ ;
+
+.ifdef DEBUG_PORTS
+ ldi uart_rxtx,0x21
+ rcall UART_TX
+.endif
+ ; calculate address
+
+ ; font base address
+ ldi ZL,low(FONTS*2)
+ ldi ZH,high(FONTS*2)
+.ifdef DEBUG_PORTS
+ mov uart_rxtx,ZH
+ rcall UART_TX
+ mov uart_rxtx,ZL
+ rcall UART_TX
+ ldi uart_rxtx,0x2d
+ rcall UART_TX
+.endif
+
+ ; framebuffer base address
+ ldi YL,low(FB_C)
+ ldi YH,high(FB_C)
+.ifdef DEBUG_PORTS
+ mov uart_rxtx,YH
+ rcall UART_TX
+ mov uart_rxtx,YL
+ rcall UART_TX
+ ldi uart_rxtx,0x2d
+ rcall UART_TX
+.endif
+
+ ; font offset
+ mov XL,count
+ ldi XH,0
+ ; times 8 == 3 left shifts
+ rol XL
+ rol XH
+ rol XL
+ rol XH
+ rol XL
+ rol XH
+.ifdef DEBUG_PORTS
+ mov uart_rxtx,XH
+ rcall UART_TX
+ mov uart_rxtx,XL
+ rcall UART_TX
+ ldi uart_rxtx,0x2d
+ rcall UART_TX
+.endif
+
+ ; final font address
+ add ZL,XL
+ adc ZH,zero
+ add ZH,XH
+.ifdef DEBUG_PORTS
+ mov uart_rxtx,ZH
+ rcall UART_TX
+ mov uart_rxtx,ZL
+ rcall UART_TX
+ ldi uart_rxtx,0x2d
+ rcall UART_TX
+ mov uart_rxtx,count
+ rcall UART_TX
+.endif
+
+ ; move font data into framebuffer
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z+
+ st Y+,tmp1
+ lpm tmp1,Z
+ st Y,tmp1
+
+ ; TESTING
+ ; increment test counter
+ inc count
+ cpi count,0x80
+ brne EXIT_T1_OVF
+ ldi count,0x21
+
+EXIT_T1_OVF:
+