.include "tn2313def.inc" .def temp1 = r16 .def temp2 = r17 .def temp3 = r18 ldi temp1, $00 ldi temp2, $00 ldi temp3, $ff rcall lcd_init rcall lcd_clear lcd_number16: push temp1 push temp2 push temp3 ; ** Zehntausender ** ldi temp1, '0'-1 lcd_number1: inc temp1 subi temp2, low(10000) sbci temp3, high(10000) brcc lcd_number1 subi temp2, low(-10000) sbci temp3, high(-10000) rcall lcd_data ; ** Tausender ** ldi temp1, '0'-1 lcd_number2: inc temp1 subi temp2, low(1000) sbci temp3, high(1000) brcc lcd_number2 subi temp2, low(-1000) sbci temp3, high(-1000) rcall lcd_data ; ** Hunderter ** ldi temp1, '0'-1 lcd_number3: inc temp1 subi temp2, low(100) sbci temp3, high(100) brcc lcd_number3 subi temp2, -100 ; + 100 High-Byte nicht mehr erforderlich rcall lcd_data ; ** Zehner ** ldi temp1, '0'-1 lcd_number4: inc temp1 subi temp2, 10 brcc lcd_number4 subi temp2, -10 rcall lcd_data ; ** Einer ** ldi temp1, '0' add temp1, temp2 rcall lcd_data ; ** Stack aufräumen ** pop temp3 pop temp2 pop temp1 l2cd_number16: push temp1 push temp2 push temp3 ; ** Zehntausender ** ldi temp1, '0'-1 l2cd_number1: inc temp1 subi temp2, low(10000) sbci temp3, high(10000) brcc l2cd_number1 subi temp2, low(-10000) sbci temp3, high(-10000) rcall lcd_data ; ** Tausender ** ldi temp1, '0'-1 l2cd_number2: inc temp1 subi temp2, low(1000) sbci temp3, high(1000) brcc l2cd_number2 subi temp2, low(-1000) sbci temp3, high(-1000) rcall lcd_data ; ** Hunderter ** ldi temp1, '0'-1 l2cd_number3: inc temp1 subi temp2, low(100) sbci temp3, high(100) brcc l2cd_number3 subi temp2, -100 ; + 100 High-Byte nicht mehr erforderlich rcall lcd_data ; ** Zehner ** ldi temp1, '0'-1 l2cd_number4: inc temp1 subi temp2, 10 brcc l2cd_number4 subi temp2, -10 rcall lcd_data ; ** Einer ** ldi temp1, '0' add temp1, temp2 rcall lcd_data ; ** Stack aufräumen ** pop temp3 pop temp2 pop temp1 loop: rjmp loop .include "c:\lcd-routines.asm"