@@ -217,6 +217,33 @@ int run_assembly()
217
217
printf (" Assembly time: %0.3f seconds\n " , (float ) s_diff + ((float ) ms_diff / 1000 .0f ));
218
218
return exit_code;
219
219
}
220
+ void print_help_message (void ){
221
+ puts (" SPASM-ng Z80 Assembler by Spencer Putt and Don Straney" );
222
+ printf (" Version %s (built on %s @ %s)\n " , SPASM_NG_VERSION, __DATE__, __TIME__);
223
+ #ifdef SPASM_NG_GITREV
224
+ printf (" Git revision %s\n " , SPASM_NG_GITREV);
225
+ #endif
226
+ #ifdef _M_X64
227
+ puts (" 64-bit Version" );
228
+ #endif
229
+ #ifdef NO_APPSIGN
230
+ printf (" \n App signing is NOT available in this build of SPASM.\n " );
231
+ #endif
232
+ puts (" \n spasm [options] <input file> <output file>\n " );
233
+ puts (" Options:\n -E = Assemble eZ80 code\n -T = Generate code listing\n -C = Code counter mode\n -L = Symbol table mode\n -S = Stats mode\n -O = Don't write to output file" );
234
+ puts (" -I [directory] = Add include directory\n -A = Labels are cAse-sensitive\n -D<name>[=value] = Create a define 'name' [with 'value']" );
235
+ puts (" -N = Don't use colors for messages" );
236
+ puts (" -V <Expression> = Pipe expression directly into assembly" );
237
+ puts (" -H = Print this help message" );
238
+
239
+ #if defined(_DEBUG) && defined(WIN32)
240
+ if (IsDebuggerPresent ())
241
+ {
242
+ system (" PAUSE" );
243
+ }
244
+ #endif
245
+ exit (EXIT_NORMAL);
246
+ }
220
247
221
248
#if 0
222
249
int CALLBACK WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCommandLine, int nCmdShow)
@@ -237,30 +264,7 @@ int main (int argc, char **argv)
237
264
238
265
// if there aren't enough args, show info
239
266
if (argc < 2 ) {
240
- puts (" SPASM-ng Z80 Assembler by Spencer Putt and Don Straney" );
241
- printf (" Version %s (built on %s @ %s)\n " , SPASM_NG_VERSION, __DATE__, __TIME__);
242
- #ifdef SPASM_NG_GITREV
243
- printf (" Git revision %s\n " , SPASM_NG_GITREV);
244
- #endif
245
- #ifdef _M_X64
246
- puts (" 64-bit Version" );
247
- #endif
248
- #ifdef NO_APPSIGN
249
- printf (" \n App signing is NOT available in this build of SPASM.\n " );
250
- #endif
251
- puts (" \n spasm [options] <input file> <output file>\n " );
252
- puts (" Options:\n -E = Assemble eZ80 code\n -T = Generate code listing\n -C = Code counter mode\n -L = Symbol table mode\n -S = Stats mode\n -O = Don't write to output file" );
253
- puts (" -I [directory] = Add include directory\n -A = Labels are cAse-sensitive\n -D<name>[=value] = Create a define 'name' [with 'value']" );
254
- puts (" -N = Don't use colors for messages" );
255
- puts (" -V <Expression> = Pipe expression directly into assembly" );
256
-
257
- #if defined(_DEBUG) && defined(WIN32)
258
- if (IsDebuggerPresent ())
259
- {
260
- system (" PAUSE" );
261
- }
262
- #endif
263
- return EXIT_NORMAL;
267
+ print_help_message ();
264
268
}
265
269
266
270
// init stuff
@@ -388,6 +392,10 @@ int main (int argc, char **argv)
388
392
strcat (input_contents, " \n " );
389
393
break ;
390
394
}
395
+ case ' H' :
396
+ case ' h' :
397
+ print_help_message ();
398
+ break ;
391
399
default :
392
400
{
393
401
#ifndef _TEST
0 commit comments