call lcd_home
ldis r1, 0x44 ; 'D'
call u_send_byte
-
- call delay5ms ; print 'E' on LCD and UART
- ldis r1, 0x45 ; 'E'
- push r1
- call lcd_data
- pop r1
- call+ u_send_byte
call+ u_send_newline
+ ldis r0, 0x00 ; init line var (we begin at line 0 ofc)
+ push r0
+
loop:
call+ u_recv_byte ; print received Char on LCD
+ cmpi r0, 0x0d ; change line on '\r'
+ breq l_nl
addi r1, r0, 0
call+ lcd_data
br loop
+l_nl:
+ pop r1
+ cmpi r1, 0
+ brnq l_ln1
+l_ln0:
+ ldis r1, 1
+ push r1
+ ldis r1, 0xc0 ; jump to second line
+ call+ lcd_command
+ call delay5ms
+ br+ loop
+
+l_ln1:
+ ldis r1, 0
+ push r1
+ ldis r1, 0x80 ; jump to first line
+ call+ lcd_command
+ br+ loop
+
hang: br+ hang
.define LCD_BASE, 0x2050
call+ lcd_enable
call+ delay5ms
- ldis r1, 0x24
+ ; ldis r1, 0x24
+ ldis r1, 0x2c ; 4bit interface, 2/4zeiliges display, 5x10 font
call+ lcd_command
- ldis r1, 0xc
+ ldis r1, 0xf ; display an, cursor an, cursor blinkt
call+ lcd_command
- ldis r1, 0x4
+ ldis r1, 0x4 ; display fest
call+ lcd_command
ret