4 .define UART_BASE, 0x2000
5 .define UART_STATUS, 0x0
7 .define UART_TRANS, 0x8
9 .define UART_TRANS_EMPTY, 0x1
10 .define UART_RECV_NEW, 0x2
20 ldih r10, UART_BASE@hi
22 ldw r3, UART_STATUS(r10)
23 andx r3, UART_RECV_NEW
24 brzs+ poll; branch if zero
27 ; we received the enter bootrom sign
35 ldw r3, UART_STATUS(r10)
36 andx r3, UART_TRANS_EMPTY
37 brnz+ send_byte ; branch if not zero
38 stb r1, UART_TRANS(r10)
55 ldw r3, UART_STATUS(r10)
56 andx r3, UART_RECV_NEW
57 brzs+ recv_byte; branch if zero
59 ldb r0, UART_RECV(r10)
106 ; cmpi r0, 0x48 ; 'H'
117 call recv_word ; receive addr
119 call recv_word ; receive instr
126 call recv_word ; receive addr
135 call recv_word ; receive addr
137 call recv_word ; receive data
144 call recv_word ; receive addr