XA 2.2.7
- Extended the "#print" command to make the formatting of size output nicer by using the '=' symbol as a separator between the expression and some arbitrary string on the left hand side
Originally the code would typically look like that:
which would display
Now instead we can just use
which would output
Not a major change, but it makes it much nicer to output a bunch of data in a compact and readable way:
will result in that output:
@@ -352,6 +352,9 @@ | ||
352 | 352 | <p>Here is the list of all releases with a short description of things that changed: |
353 | 353 | </p> |
354 | 354 | |
355 | +<p id=dateentry>2.2.7</p> | |
356 | +- Extended the "#print" command to make the formatting of size output nicer by using the '=' symbol as a separator between the expression and some arbitrary string on the left hand side | |
357 | + | |
355 | 358 | <p id=dateentry>2.2.6</p> |
356 | 359 | - Returns an Error Code value 1 if a source file is missing |
357 | 360 |
@@ -24,6 +24,7 @@ | ||
24 | 24 | <li>Fixed the debugger documentation with the modified Oricutron commands, and fixed the HTML to actually show the parameters</li> |
25 | 25 | <li>Added the BASIC flood fill sample program from Geoff Phillips book "Oric Atmos and Oric 1 Graphics and Machine code techniques" in sample\basic\paint</li> |
26 | 26 | <li>Added the C equivalent flood fill routine in sample\c\paint</li> |
27 | + <li>Upgraded <A href="doc_assembler.htm">XA</A> to the version 2.2.7 which an extended syntax for the #print command to allow displaying information on a single line</li> | |
27 | 28 | </ul> |
28 | 29 | |
29 | 30 | <p id=dateentry>Version 1.20 - January 14th 2023</p> |
@@ -93,9 +93,9 @@ | ||
93 | 93 | static const char *copyright= |
94 | 94 | { |
95 | 95 | #ifdef _WIN32 |
96 | - "Cross-Assembler 65xx V2.2.6 (" __TIME__ " / " __DATE__ ") \r\n" | |
96 | + "Cross-Assembler 65xx V2.2.7 (" __TIME__ " / " __DATE__ ") \r\n" | |
97 | 97 | #else |
98 | - "Cross-Assembler 65xx V2.2.6 (No date available) \r\n" | |
98 | + "Cross-Assembler 65xx V2.2.7 (No date available) \r\n" | |
99 | 99 | #endif |
100 | 100 | "(c) 1989-98 by A.Fachat\r\n" |
101 | 101 | "65816 opcodes and modes coded by Jolse Maginnis\r\n" |
@@ -171,11 +171,27 @@ | ||
171 | 171 | return E_OK; |
172 | 172 | } |
173 | 173 | |
174 | +// There are now two possible syntaxes: | |
175 | +// #print expression | |
176 | +// #print some stuff to print = expression | |
174 | 177 | ErrorCode Preprocessor::command_print(char *t) |
175 | 178 | { |
176 | 179 | int f,a,er; |
177 | 180 | |
178 | - logout(t); | |
181 | + char* equalPtr = strchr(t, '='); | |
182 | + if (equalPtr) | |
183 | + { | |
184 | + // Found a "=" symbol: We print out the left hand side expression as is, and move the pointer to after the expression | |
185 | + *equalPtr++ = 0; | |
186 | + logout(t); | |
187 | + t = equalPtr; | |
188 | + } | |
189 | + else | |
190 | + { | |
191 | + // No "=" symbol found | |
192 | + logout(t); | |
193 | + } | |
194 | + | |
179 | 195 | if ((er=pp_replace(BufferLine,t,-1,m_CurrentListIndex))) |
180 | 196 | { |
181 | 197 | logout("\n"); |
@@ -185,7 +201,7 @@ | ||
185 | 201 | { |
186 | 202 | logout("="); |
187 | 203 | logout(BufferLine); |
188 | - logout("="); | |
204 | + logout("= "); | |
189 | 205 | er=b_term(BufferLine,&a,&f,TablePcSegment[gCurrentSegment]); |
190 | 206 | if (er) |
191 | 207 | { |