X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=progs%2Fdeepjit.s;h=871879aed2da7e32eaa8a5c86586a324a33808ed;hb=7e404f2c1ac8fb44904761beaa2777ec973469e5;hp=c0352d8fbeea06ebc0021dd2001ae90a163f8430;hpb=48de8a90471559126c929bc7253e6edf34da28fa;p=calu.git diff --git a/progs/deepjit.s b/progs/deepjit.s index c0352d8..871879a 100644 --- a/progs/deepjit.s +++ b/progs/deepjit.s @@ -1,4 +1,5 @@ #define PROGINSTR stw r0, PDATA(r13) +#include "dt_inc.s" .data .org 0x10 inputdata: @@ -103,49 +104,25 @@ prog_not: .ifill push r6 .text - .define UART_BASE, 0x2000 - .define UART_STATUS, 0x0 - .define UART_RECV, 0xc - .define UART_TRANS, 0x8 - - .define UART_TRANS_EMPTY, 0x1 - .define UART_RECV_NEW, 0x2 - - .define PBASE, 0x2030 - .define PADDR, 0x4 - .define PDATA, 0x8 .org 0 start: - call main - call main + call+ main + call+ main ret main: - ldi r10, UART_BASE@lo - ldih r10, UART_BASE@hi -;recv byte -u_recv_byte: - ldw r3, UART_STATUS(r10) - andx r3, UART_RECV_NEW - brzs+ u_recv_byte; branch if zero - - ldw r0, UART_RECV(r10) -;recv byte - ldis r0, 0x48 -u_test: - ldw r9, UART_STATUS(r10) - andx r9, UART_TRANS_EMPTY - brnz+ u_test ; branch if not zero - stb r0, UART_TRANS(r10) + call+ u_init + call+ u_recv_byte + ldis r1, 0x48 + call+ u_send_byte ;set address of input ldis r1, inputdata@lo ldih r1, inputdata@hi - ;set address of program start ldis r2, (prog_start/4)@lo ldih r2, (prog_start/4)@hi @@ -161,7 +138,6 @@ u_test: ldis r13, PBASE@lo ldih r13, PBASE@hi - ;set programmer address stw r2, PADDR(r13) @@ -180,26 +156,10 @@ u_test: ;call jit'ed prog call+ prog_start -;send result - push r0 - ldi r10, UART_BASE@lo - ldih r10, UART_BASE@hi - -u_send_by1: - ldw r9, UART_STATUS(r10) - andx r9, UART_TRANS_EMPTY - brnz+ u_send_by1 ; branch if not zero - ldis r0, 0x50 - stb r0, UART_TRANS(r10) - -u_send_byte: - ldw r9, UART_STATUS(r10) - andx r9, UART_TRANS_EMPTY - brnz+ u_send_byte ; branch if not zero - pop r0 - stb r0, UART_TRANS(r10) - -;send result + call+ u_init + + mov r1, r0 + call+ u_send_byte br+ main