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