4 .define UART_BASE, 0x1000
5 .define UART_STATUS, UART_BASE+0x4
6 .define UART_RECV, UART_BASE+0x8
7 .define UART_TRANS, UART_BASE+0xC
8 .define UART_BAUD, UART_BASE+0x10
10 .define UART_TRANS_EMPTY, 0
11 .define UART_RECV_NEW, 1
13 .define TIMEOUT_START, 0x13371337
14 .define DEFAULT_PROG_START, 0x200
15 .define STACKSTART, 0x500 ; FIXME
19 ldil r15, STACKSTART@lo
20 ldih r15, STACKSTART@hi
23 ldil r3, TIMEOUT_START@lo
24 ldih r3, TIMEOUT_START@hi
27 ldil r3, UART_STATUS@lo
28 ldih r3, UART_STATUS@hi
30 andx r3, 1 << UART_RECV_NEW
31 brzs+ next; branch if zero
34 ; we received the enter bootrom sign
42 ; call to default entry point
43 ldil r0, DEFAULT_PROG_START@lo
44 ldih r0, DEFAULT_PROG_START@hi
49 ldil r3, UART_STATUS@lo
50 ldih r3, UART_STATUS@hi
52 andx r3, 1 << UART_TRANS_EMPTY
53 brzs+ send_byte ; branch if zero
54 ldil r3, UART_TRANS@lo
55 ldih r3, UART_TRANS@hi
73 ldil r3, UART_STATUS@lo
74 ldih r3, UART_STATUS@hi
76 andx r3, 1 << UART_RECV_NEW
77 brzs+ send_byte ; branch if zero
122 ; cmpi r0, 0x48 ; 'H'
132 call recv_word ; receive addr
134 call recv_word ; receive instr
141 call recv_word ; receive addr
150 call recv_word ; receive addr
152 call recv_word ; receive data
159 call recv_word ; receive addr
171 ; 102 instr. please update after modification