annotate src/strings.inc @ 421:3895adc3477f

fix Page-Program timing
author heinrichsweikamp
date Fri, 29 Apr 2016 16:40:10 +0200
parents e79bc535ef9e
children ca4556fb60b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
heinrichsweikamp
parents:
diff changeset
3 ; File strings.asm
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Implementation code various string functions.
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2010-12-02 : [jDG] Creation...
heinrichsweikamp
parents:
diff changeset
11 ;
heinrichsweikamp
parents:
diff changeset
12
heinrichsweikamp
parents:
diff changeset
13 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
14 ; Copy a short embebed string at start of the string buffer (letter)
heinrichsweikamp
parents:
diff changeset
15 ; Input: (nothing)
heinrichsweikamp
parents:
diff changeset
16 ; Output: chars are copied into letter, starting at the beginning.
heinrichsweikamp
parents:
diff changeset
17 ; FSR2 point to the first unused char (the NULL termination).
heinrichsweikamp
parents:
diff changeset
18 ;
heinrichsweikamp
parents:
diff changeset
19 ; Trashed: WREG, TBLPTR, TABLAT, PRODL
heinrichsweikamp
parents:
diff changeset
20 ; Note: This are all bank-safe call.
heinrichsweikamp
parents:
diff changeset
21 ;
heinrichsweikamp
parents:
diff changeset
22 extern strcpy_block
heinrichsweikamp
parents:
diff changeset
23 STRCPY macro string
heinrichsweikamp
parents:
diff changeset
24 call strcpy_block
heinrichsweikamp
parents:
diff changeset
25 DB string, 0
heinrichsweikamp
parents:
diff changeset
26 endm
heinrichsweikamp
parents:
diff changeset
27
heinrichsweikamp
parents:
diff changeset
28 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
29 ; A variant of STRCPY that appends chars to the current FSR2 pointer.
heinrichsweikamp
parents:
diff changeset
30 ; Input/Output/Trashed : see STRCPY.
heinrichsweikamp
parents:
diff changeset
31 extern strcat_block
heinrichsweikamp
parents:
diff changeset
32 STRCAT macro string
heinrichsweikamp
parents:
diff changeset
33 call strcat_block
heinrichsweikamp
parents:
diff changeset
34 DB string, 0
heinrichsweikamp
parents:
diff changeset
35 endm
heinrichsweikamp
parents:
diff changeset
36
heinrichsweikamp
parents:
diff changeset
37 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
38 ; A variant of STRCAT when there is just on char to output
heinrichsweikamp
parents:
diff changeset
39 ; Input/Output/Trashed : none.
heinrichsweikamp
parents:
diff changeset
40 PUTC macro char
heinrichsweikamp
parents:
diff changeset
41 movlw char
heinrichsweikamp
parents:
diff changeset
42 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
43 endm
heinrichsweikamp
parents:
diff changeset
44
heinrichsweikamp
parents:
diff changeset
45 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
46 ; A variant of STRCPY that send the string to the word processor afterwards.
heinrichsweikamp
parents:
diff changeset
47 ; Input/Output: see STRCPY.
heinrichsweikamp
parents:
diff changeset
48 ; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1
heinrichsweikamp
parents:
diff changeset
49 ;
heinrichsweikamp
parents:
diff changeset
50 extern strcpy_block_print
heinrichsweikamp
parents:
diff changeset
51 STRCPY_PRINT macro string
heinrichsweikamp
parents:
diff changeset
52 call strcpy_block_print
heinrichsweikamp
parents:
diff changeset
53 DB string, 0
heinrichsweikamp
parents:
diff changeset
54 endm
heinrichsweikamp
parents:
diff changeset
55
heinrichsweikamp
parents:
diff changeset
56 ; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1
heinrichsweikamp
parents:
diff changeset
57 extern strcat_block_print
heinrichsweikamp
parents:
diff changeset
58 STRCAT_PRINT macro string
heinrichsweikamp
parents:
diff changeset
59 call strcat_block_print
heinrichsweikamp
parents:
diff changeset
60 DB string, 0
heinrichsweikamp
parents:
diff changeset
61 endm
heinrichsweikamp
parents:
diff changeset
62
heinrichsweikamp
parents:
diff changeset
63 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
64 ; Subroutines to operate on strings from PROM code
heinrichsweikamp
parents:
diff changeset
65 ;
heinrichsweikamp
parents:
diff changeset
66 ; Input: TBLPTR : string pointer into PROM.
heinrichsweikamp
parents:
diff changeset
67 ; Output: string in buffer, FSR2 pointer on the closing null byte.
heinrichsweikamp
parents:
diff changeset
68
heinrichsweikamp
parents:
diff changeset
69 extern strcpy_prom, strcat_prom
heinrichsweikamp
parents:
diff changeset
70 extern strcpy_prom_print, strcat_prom_print
heinrichsweikamp
parents:
diff changeset
71
heinrichsweikamp
parents:
diff changeset
72 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
73 ; Subroutines and macros to operate on multilingual text
heinrichsweikamp
parents:
diff changeset
74 ;
heinrichsweikamp
parents:
diff changeset
75 extern strcpy_text
heinrichsweikamp
parents:
diff changeset
76 STRCPY_TEXT macro txt
heinrichsweikamp
parents:
diff changeset
77 extern txt
heinrichsweikamp
parents:
diff changeset
78 lfsr FSR1, txt
heinrichsweikamp
parents:
diff changeset
79 call strcpy_text
heinrichsweikamp
parents:
diff changeset
80 endm
heinrichsweikamp
parents:
diff changeset
81
heinrichsweikamp
parents:
diff changeset
82 extern strcpy_text_print
heinrichsweikamp
parents:
diff changeset
83 STRCPY_TEXT_PRINT macro txt
heinrichsweikamp
parents:
diff changeset
84 extern txt
heinrichsweikamp
parents:
diff changeset
85 lfsr FSR1, txt
heinrichsweikamp
parents:
diff changeset
86 call strcpy_text_print
heinrichsweikamp
parents:
diff changeset
87 endm
heinrichsweikamp
parents:
diff changeset
88
heinrichsweikamp
parents:
diff changeset
89 extern strcat_text
heinrichsweikamp
parents:
diff changeset
90 STRCAT_TEXT macro txt
heinrichsweikamp
parents:
diff changeset
91 extern txt
heinrichsweikamp
parents:
diff changeset
92 lfsr FSR1, txt
heinrichsweikamp
parents:
diff changeset
93 call strcat_text
heinrichsweikamp
parents:
diff changeset
94 endm
heinrichsweikamp
parents:
diff changeset
95
heinrichsweikamp
parents:
diff changeset
96 extern strcat_text_print
heinrichsweikamp
parents:
diff changeset
97 STRCAT_TEXT_PRINT macro txt
heinrichsweikamp
parents:
diff changeset
98 extern txt
heinrichsweikamp
parents:
diff changeset
99 lfsr FSR1, txt
heinrichsweikamp
parents:
diff changeset
100 call strcat_text_print
heinrichsweikamp
parents:
diff changeset
101 endm
heinrichsweikamp
parents:
diff changeset
102
heinrichsweikamp
parents:
diff changeset
103 ;=============================================================================
189
e79bc535ef9e ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents: 0
diff changeset
104 ; A shortcut for the macros WIN_TOP + WIN_LEFT + WIN_FONT.
0
heinrichsweikamp
parents:
diff changeset
105 ; The idea is to replace a 4x6=24 bytes sequence by a more compact 6bytes one.
heinrichsweikamp
parents:
diff changeset
106 ;
heinrichsweikamp
parents:
diff changeset
107 ; Trashed: TBLPTR, TABLAT, WREG.
heinrichsweikamp
parents:
diff changeset
108 ; Note: This are all bank-safe call.
heinrichsweikamp
parents:
diff changeset
109 extern start_tiny_block
heinrichsweikamp
parents:
diff changeset
110 WIN_TINY macro x, y
heinrichsweikamp
parents:
diff changeset
111 call start_tiny_block
heinrichsweikamp
parents:
diff changeset
112 DB x, y
heinrichsweikamp
parents:
diff changeset
113 endm
heinrichsweikamp
parents:
diff changeset
114
heinrichsweikamp
parents:
diff changeset
115 extern start_small_block
heinrichsweikamp
parents:
diff changeset
116 WIN_SMALL macro x, y
heinrichsweikamp
parents:
diff changeset
117 call start_small_block
heinrichsweikamp
parents:
diff changeset
118 DB x, y
heinrichsweikamp
parents:
diff changeset
119 endm
heinrichsweikamp
parents:
diff changeset
120
heinrichsweikamp
parents:
diff changeset
121 extern start_std_block
heinrichsweikamp
parents:
diff changeset
122 WIN_STD macro x, y
heinrichsweikamp
parents:
diff changeset
123 call start_std_block
heinrichsweikamp
parents:
diff changeset
124 DB x, y
heinrichsweikamp
parents:
diff changeset
125 endm
heinrichsweikamp
parents:
diff changeset
126
heinrichsweikamp
parents:
diff changeset
127 extern start_medium_block
heinrichsweikamp
parents:
diff changeset
128 WIN_MEDIUM macro x, y
heinrichsweikamp
parents:
diff changeset
129 call start_medium_block
heinrichsweikamp
parents:
diff changeset
130 DB x, y
heinrichsweikamp
parents:
diff changeset
131 endm
heinrichsweikamp
parents:
diff changeset
132
heinrichsweikamp
parents:
diff changeset
133 extern start_large_block
heinrichsweikamp
parents:
diff changeset
134 WIN_LARGE macro x, y
heinrichsweikamp
parents:
diff changeset
135 call start_large_block
heinrichsweikamp
parents:
diff changeset
136 DB x, y
heinrichsweikamp
parents:
diff changeset
137 endm
heinrichsweikamp
parents:
diff changeset
138
heinrichsweikamp
parents:
diff changeset
139 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
140 ; Shortcuts for compact display programmings.
heinrichsweikamp
parents:
diff changeset
141 TEXT_TINY macro x, y, txt
heinrichsweikamp
parents:
diff changeset
142 WIN_TINY x,y
heinrichsweikamp
parents:
diff changeset
143 STRCPY_TEXT_PRINT txt
heinrichsweikamp
parents:
diff changeset
144 endm
heinrichsweikamp
parents:
diff changeset
145
heinrichsweikamp
parents:
diff changeset
146 TEXT_SMALL macro x, y, txt
heinrichsweikamp
parents:
diff changeset
147 WIN_SMALL x,y
heinrichsweikamp
parents:
diff changeset
148 STRCPY_TEXT_PRINT txt
heinrichsweikamp
parents:
diff changeset
149 endm
heinrichsweikamp
parents:
diff changeset
150
heinrichsweikamp
parents:
diff changeset
151 TEXT_SMALL_INVERT macro x, y, txt
heinrichsweikamp
parents:
diff changeset
152 WIN_SMALL_INVERT x,y
heinrichsweikamp
parents:
diff changeset
153 STRCPY_TEXT_PRINT txt
heinrichsweikamp
parents:
diff changeset
154 endm
heinrichsweikamp
parents:
diff changeset
155
heinrichsweikamp
parents:
diff changeset
156 TEXT_MEDIUM macro x, y, txt
heinrichsweikamp
parents:
diff changeset
157 WIN_MEDIUM x,y
heinrichsweikamp
parents:
diff changeset
158 STRCPY_TEXT_PRINT txt
heinrichsweikamp
parents:
diff changeset
159 endm
heinrichsweikamp
parents:
diff changeset
160
heinrichsweikamp
parents:
diff changeset
161 TEXT_LARGE macro x, y, txt
heinrichsweikamp
parents:
diff changeset
162 WIN_LARGE x,y
heinrichsweikamp
parents:
diff changeset
163 STRCPY_TEXT_PRINT txt
heinrichsweikamp
parents:
diff changeset
164 endm
heinrichsweikamp
parents:
diff changeset
165
heinrichsweikamp
parents:
diff changeset
166 STRING_TINY macro x, y, string
heinrichsweikamp
parents:
diff changeset
167 WIN_SMALL x,y
heinrichsweikamp
parents:
diff changeset
168 STRCPY_PRINT string
heinrichsweikamp
parents:
diff changeset
169 endm
heinrichsweikamp
parents:
diff changeset
170
heinrichsweikamp
parents:
diff changeset
171 STRING_SMALL macro x, y, string
heinrichsweikamp
parents:
diff changeset
172 WIN_SMALL x,y
heinrichsweikamp
parents:
diff changeset
173 STRCPY_PRINT string
heinrichsweikamp
parents:
diff changeset
174 endm
heinrichsweikamp
parents:
diff changeset
175
heinrichsweikamp
parents:
diff changeset
176 STRING_MEDIUM macro x, y, string
heinrichsweikamp
parents:
diff changeset
177 WIN_MEDIUM x,y
heinrichsweikamp
parents:
diff changeset
178 STRCPY_PRINT string
heinrichsweikamp
parents:
diff changeset
179 endm
heinrichsweikamp
parents:
diff changeset
180
heinrichsweikamp
parents:
diff changeset
181 STRING_LARGE macro x, y, string
heinrichsweikamp
parents:
diff changeset
182 WIN_LARGE x,y
heinrichsweikamp
parents:
diff changeset
183 STRCPY_PRINT string
heinrichsweikamp
parents:
diff changeset
184 endm
heinrichsweikamp
parents:
diff changeset
185