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