Mercurial > public > hwos_code
comparison src/strings.asm @ 448:aadfe9f2edaf
work on new battery options
author | heinrichsweikamp |
---|---|
date | Tue, 30 Aug 2016 17:26:21 +0200 |
parents | 653a3ab08062 |
children | b7eb98dbd800 |
comparison
equal
deleted
inserted
replaced
447:f2a1d535347f | 448:aadfe9f2edaf |
---|---|
98 ; opt_language = current language. | 98 ; opt_language = current language. |
99 ; Output: TBLPTR = 24bits of PROM address. | 99 ; Output: TBLPTR = 24bits of PROM address. |
100 ; | 100 ; |
101 global text_get_tblptr | 101 global text_get_tblptr |
102 text_get_tblptr: | 102 text_get_tblptr: |
103 extern text_english_base | 103 extern text_1_base |
104 movlw UPPER(text_english_base); Complete 12bits to 24bits address. | 104 movlw UPPER(text_1_base); Complete 12bits to 24bits address. |
105 movwf TBLPTRU | 105 movwf TBLPTRU |
106 movlw HIGH(text_english_base) | 106 movlw HIGH(text_1_base) |
107 andlw 0xF0 | 107 andlw 0xF0 |
108 iorwf FSR1H,W | 108 iorwf FSR1H,W |
109 movwf TBLPTRH | 109 movwf TBLPTRH |
110 movff FSR1L,TBLPTRL | 110 movff FSR1L,TBLPTRL |
111 | 111 |
112 movff opt_language,WREG ; Get lang | 112 movff opt_language,WREG ; Get lang |
113 bz text_get_english ; 0 == English | 113 bz text_get_lang1 ; 0 == English |
114 dcfsnz WREG ; 1 == German | 114 dcfsnz WREG ; 1 == German |
115 bra text_get_german | 115 bra text_get_lang2 |
116 dcfsnz WREG ; 2 == French | 116 ; Other ??? Keep language 1 |
117 bra text_get_french | |
118 dcfsnz WREG ; 3 == Italian | |
119 bra text_get_italian | |
120 ; Other ??? Keep english... | |
121 | 117 |
122 ; Read 2-byte pointer to string | 118 ; Read 2-byte pointer to string |
123 text_get_english: | 119 text_get_lang1: |
124 tblrd*+ | 120 tblrd*+ |
125 movff TABLAT,WREG | 121 movff TABLAT,WREG |
126 tblrd*+ | 122 tblrd*+ |
127 movff WREG,TBLPTRL | 123 movff WREG,TBLPTRL |
128 movff TABLAT,TBLPTRH | 124 movff TABLAT,TBLPTRH |
129 return | 125 return |
130 | 126 |
131 ; Add correction for German table: | 127 ; Add correction for German table: |
132 text_get_german: | 128 text_get_lang2: |
133 extern text_german_base | 129 extern text_2_base |
134 movlw LOW(text_german_base) | 130 movlw LOW(text_2_base) |
135 addwf TBLPTRL | 131 addwf TBLPTRL |
136 movlw HIGH(text_german_base) | 132 movlw HIGH(text_2_base) |
137 addwfc TBLPTRH | 133 addwfc TBLPTRH |
138 movlw UPPER(text_german_base) | 134 movlw UPPER(text_2_base) |
139 addwfc TBLPTRU | 135 addwfc TBLPTRU |
140 | 136 |
141 movlw LOW(text_english_base) | 137 movlw LOW(text_1_base) |
142 subwf TBLPTRL | 138 subwf TBLPTRL |
143 movlw HIGH(text_english_base) | 139 movlw HIGH(text_1_base) |
144 subwfb TBLPTRH | 140 subwfb TBLPTRH |
145 movlw UPPER(text_english_base) | 141 movlw UPPER(text_1_base) |
146 subwfb TBLPTRU | 142 subwfb TBLPTRU |
147 bra text_get_english | 143 bra text_get_lang1 |
148 | 144 |
149 ; Add correction for French table: | |
150 text_get_french: | |
151 extern text_french_base | |
152 movlw LOW(text_french_base) | |
153 addwf TBLPTRL | |
154 movlw HIGH(text_french_base) | |
155 addwfc TBLPTRH | |
156 movlw UPPER(text_french_base) | |
157 addwfc TBLPTRU | |
158 | |
159 movlw LOW(text_english_base) | |
160 subwf TBLPTRL | |
161 movlw HIGH(text_english_base) | |
162 subwfb TBLPTRH | |
163 movlw UPPER(text_english_base) | |
164 subwfb TBLPTRU | |
165 bra text_get_english | |
166 | |
167 ; Add correction for italian table: | |
168 text_get_italian: | |
169 extern text_italian_base | |
170 movlw LOW(text_italian_base) | |
171 addwf TBLPTRL | |
172 movlw HIGH(text_italian_base) | |
173 addwfc TBLPTRH | |
174 movlw UPPER(text_italian_base) | |
175 addwfc TBLPTRU | |
176 | |
177 movlw LOW(text_english_base) | |
178 subwf TBLPTRL | |
179 movlw HIGH(text_english_base) | |
180 subwfb TBLPTRH | |
181 movlw UPPER(text_english_base) | |
182 subwfb TBLPTRU | |
183 bra text_get_english | |
184 | |
185 ;============================================================================= | 145 ;============================================================================= |
186 ; Copy a null-terminated string from TBLPTR to buffer. | 146 ; Copy a null-terminated string from TBLPTR to buffer. |
187 ; | 147 ; |
188 ; Input: TBLPTR : string pointer into PROM. | 148 ; Input: TBLPTR : string pointer into PROM. |
189 ; Output: string in buffer, FSR2 pointer on the closing null byte. | 149 ; Output: string in buffer, FSR2 pointer on the closing null byte. |