С выравниванием по байту » History » Version 2
krufter_multiclet, 07/19/2013 04:19 PM
1 | 1 | krufter_multiclet | h1. С выравниванием по байту |
---|---|---|---|
2 | 1 | krufter_multiclet | |
3 | 1 | krufter_multiclet | +Для платы HW1-MCp04:+ |
4 | 1 | krufter_multiclet | |
5 | 1 | krufter_multiclet | <pre> |
6 | 1 | krufter_multiclet | .include "HDL50001_pcf.inc" |
7 | 1 | krufter_multiclet | |
8 | 1 | krufter_multiclet | .alias DM_START 0x00000000 ;start address DM for output by uart0 |
9 | 1 | krufter_multiclet | .alias BLOCK_SIZE 0x00000100 ;end address DM for output by uart0 |
10 | 1 | krufter_multiclet | .alias iterator1 2 |
11 | 1 | krufter_multiclet | .alias byte_DM 5 |
12 | 1 | krufter_multiclet | |
13 | 1 | krufter_multiclet | .alias UART_DATA UART0_DATA |
14 | 1 | krufter_multiclet | .alias UART_BDR UART0_BDR |
15 | 1 | krufter_multiclet | .alias UART_ST UART0_ST |
16 | 1 | krufter_multiclet | .alias UART_CR UART0_CR |
17 | 1 | krufter_multiclet | |
18 | 1 | krufter_multiclet | .alias UART_PORT_PIN 0x300 |
19 | 1 | krufter_multiclet | .alias UART_PORT_BPS GPIOB_BPS |
20 | 1 | krufter_multiclet | |
21 | 1 | krufter_multiclet | .text |
22 | 1 | krufter_multiclet | |
23 | 1 | krufter_multiclet | ;config uart |
24 | 1 | krufter_multiclet | initUART: |
25 | 1 | krufter_multiclet | jmp read_DM |
26 | 1 | krufter_multiclet | getl 0x00000300 |
27 | 1 | krufter_multiclet | wrl @1, UART_PORT_BPS |
28 | 1 | krufter_multiclet | getl 0x00000104 |
29 | 1 | krufter_multiclet | wrl @1, UART_BDR |
30 | 1 | krufter_multiclet | getl 0x00000003 |
31 | 1 | krufter_multiclet | wrl @1, UART_CR |
32 | 1 | krufter_multiclet | setl #iterator1, 0x00000000 |
33 | 1 | krufter_multiclet | complete |
34 | 1 | krufter_multiclet | |
35 | 1 | krufter_multiclet | ; read DM for define address as double word (64 bits) |
36 | 1 | krufter_multiclet | read_DM: |
37 | 1 | krufter_multiclet | getl BLOCK_SIZE |
38 | 1 | krufter_multiclet | subl @1, #iterator1 |
39 | 1 | krufter_multiclet | je @1, stop2 |
40 | 1 | krufter_multiclet | jne @2, out_DM |
41 | 1 | krufter_multiclet | getl #iterator1 |
42 | 1 | krufter_multiclet | addl @1, DM_START |
43 | 1 | krufter_multiclet | rdb @1 |
44 | 1 | krufter_multiclet | setb #byte_DM, @1 |
45 | 1 | krufter_multiclet | addl @4, 0x00000001 |
46 | 1 | krufter_multiclet | setl #iterator1, @1 |
47 | 1 | krufter_multiclet | complete |
48 | 1 | krufter_multiclet | |
49 | 1 | krufter_multiclet | out_DM: |
50 | 1 | krufter_multiclet | getb #byte_DM |
51 | 1 | krufter_multiclet | wrb @1, UART_DATA ; write to tx fifo only one byte |
52 | 1 | krufter_multiclet | jmp buf_TXD |
53 | 1 | krufter_multiclet | complete |
54 | 1 | krufter_multiclet | |
55 | 1 | krufter_multiclet | ; wait for fifo transmitter not full |
56 | 1 | krufter_multiclet | buf_TXD: |
57 | 1 | krufter_multiclet | rdl UART_ST |
58 | 1 | krufter_multiclet | getl 0x00000200 |
59 | 1 | krufter_multiclet | and @1, @2 |
60 | 1 | krufter_multiclet | jne @1, buf_TXD |
61 | 1 | krufter_multiclet | je @2, read_DM |
62 | 1 | krufter_multiclet | complete |
63 | 1 | krufter_multiclet | |
64 | 1 | krufter_multiclet | ; enable led 2,3 |
65 | 1 | krufter_multiclet | stop2: |
66 | 1 | krufter_multiclet | getl 0x1000 |
67 | 1 | krufter_multiclet | complete |
68 | 1 | krufter_multiclet | </pre> |
69 | 1 | krufter_multiclet | |
70 | 2 | krufter_multiclet | +Замечание:+ |
71 | 2 | krufter_multiclet | |
72 | 1 | krufter_multiclet | +Для платы LDM-MCp04:+ |
73 | 1 | krufter_multiclet | <pre> |
74 | 1 | krufter_multiclet | .include "HDL50001_pcf.inc" |
75 | 1 | krufter_multiclet | |
76 | 1 | krufter_multiclet | .alias DM_START 0x00000000 ;start address DM for output by uart0 |
77 | 1 | krufter_multiclet | .alias BLOCK_SIZE 0x00000100 ;end address DM for output by uart0 |
78 | 1 | krufter_multiclet | .alias iterator1 2 |
79 | 1 | krufter_multiclet | .alias byte_DM 5 |
80 | 1 | krufter_multiclet | |
81 | 1 | krufter_multiclet | .alias UART_DATA UART3_DATA |
82 | 1 | krufter_multiclet | .alias UART_BDR UART3_BDR |
83 | 1 | krufter_multiclet | .alias UART_ST UART3_ST |
84 | 1 | krufter_multiclet | .alias UART_CR UART3_CR |
85 | 1 | krufter_multiclet | |
86 | 1 | krufter_multiclet | .alias UART_PORT_PIN 0x300 |
87 | 1 | krufter_multiclet | .alias UART_PORT_BPS GPIOD_BPS |
88 | 1 | krufter_multiclet | |
89 | 1 | krufter_multiclet | .text |
90 | 1 | krufter_multiclet | |
91 | 1 | krufter_multiclet | ;config uart |
92 | 1 | krufter_multiclet | initUART: |
93 | 1 | krufter_multiclet | jmp read_DM |
94 | 1 | krufter_multiclet | getl 0x00000300 |
95 | 1 | krufter_multiclet | wrl @1, UART_PORT_BPS |
96 | 1 | krufter_multiclet | getl 0x00000104 |
97 | 1 | krufter_multiclet | wrl @1, UART_BDR |
98 | 1 | krufter_multiclet | getl 0x00000003 |
99 | 1 | krufter_multiclet | wrl @1, UART_CR |
100 | 1 | krufter_multiclet | setl #iterator1, 0x00000000 |
101 | 1 | krufter_multiclet | complete |
102 | 1 | krufter_multiclet | |
103 | 1 | krufter_multiclet | ; read DM for define address as double word (64 bits) |
104 | 1 | krufter_multiclet | read_DM: |
105 | 1 | krufter_multiclet | getl BLOCK_SIZE |
106 | 1 | krufter_multiclet | subl @1, #iterator1 |
107 | 1 | krufter_multiclet | je @1, stop2 |
108 | 1 | krufter_multiclet | jne @2, out_DM |
109 | 1 | krufter_multiclet | getl #iterator1 |
110 | 1 | krufter_multiclet | addl @1, DM_START |
111 | 1 | krufter_multiclet | rdb @1 |
112 | 1 | krufter_multiclet | setb #byte_DM, @1 |
113 | 1 | krufter_multiclet | addl @4, 0x00000001 |
114 | 1 | krufter_multiclet | setl #iterator1, @1 |
115 | 1 | krufter_multiclet | complete |
116 | 1 | krufter_multiclet | |
117 | 1 | krufter_multiclet | out_DM: |
118 | 1 | krufter_multiclet | getb #byte_DM |
119 | 1 | krufter_multiclet | wrb @1, UART_DATA ; write to tx fifo only one byte |
120 | 1 | krufter_multiclet | jmp buf_TXD |
121 | 1 | krufter_multiclet | complete |
122 | 1 | krufter_multiclet | |
123 | 1 | krufter_multiclet | ; wait for fifo transmitter not full |
124 | 1 | krufter_multiclet | buf_TXD: |
125 | 1 | krufter_multiclet | rdl UART_ST |
126 | 1 | krufter_multiclet | getl 0x00000200 |
127 | 1 | krufter_multiclet | and @1, @2 |
128 | 1 | krufter_multiclet | jne @1, buf_TXD |
129 | 1 | krufter_multiclet | je @2, read_DM |
130 | 1 | krufter_multiclet | complete |
131 | 1 | krufter_multiclet | |
132 | 1 | krufter_multiclet | ; enable led 2,3 |
133 | 1 | krufter_multiclet | stop2: |
134 | 1 | krufter_multiclet | getl 0x1000 |
135 | 1 | krufter_multiclet | complete |
136 | 1 | krufter_multiclet | </pre> |