shit not working
[calu.git] / progs / testbench.s
index b98784cf63796e6ff563405fe50d7bd388b1dd53..cc86e478d132b5626190157237f90c34824fedda 100644 (file)
@@ -1,9 +1,10 @@
 #include "dt_inc.s"
 .text
+       .define LCDBASE, 0x2060
+       .define LCDSTATUS, 0x0
+       .define LCDADDR, 0x4
+
 .org 0x0
-       .define TIMER_BASE, 0x2040
-       .define T_STCFG, 0x0
-       .define T_VAL, 0x4
 start:
        br+ main
        br+ main
@@ -16,22 +17,22 @@ main:
        ldis r1, 0x42
        call u_send_byte
 
-       ldis r11, TIMER_BASE@lo
-       ldih r11, TIMER_BASE@hi
-
-       ldis r1, 0x1
-       stw r1, T_STCFG(r11)
+       call t_init
+       call t_start
 
 loop:
        call u_recv_byte
-       cmpi r0, 0x42
-       breq bla
-       ldw r1, T_VAL(r11)
-       call u_send_uint
-       call u_send_newline
+       ldi r0, LCDBASE@lo
+       ldih r0, LCDBASE@hi
+       ldw r1, LCDSTATUS(r0)
+       call u_send_byte
+       ldi r0, LCDBASE@lo
+       ldih r0, LCDBASE@hi
+       ldis r1, 0x141
+       stw r1, LCDADDR(r0)
        br loop
 
-bla:
+reset_timer:
        ldis r1, 0
-       stw r1, T_VAL(r11)
+       call t_valset
        br loop