diff --git a/scp.c b/scp.c index a7c66c86..6dc932e3 100644 --- a/scp.c +++ b/scp.c @@ -1180,6 +1180,9 @@ static const char simh_help[] = "+set clock nocatchup disable catchup clock ticks\n" "+set clock catchup enable catchup clock ticks\n" "+set clock calib=n%% specify idle calibration skip %%\n" + "+set clock stop=n stop execution after n instructions\n\n" + " The set clock stop command allows execution to have a bound when\n" + " execution starts with a BOOT, NEXT or CONTINUE command.\n" #define HLP_SET_ASYNCH "*Commands SET Asynch" "3Asynch\n" "+set asynch enable asynchronous I/O\n" @@ -8383,7 +8386,7 @@ CONST char *tptr; *status = SCPE_OK; val = strtotv ((CONST char *)cptr, &tptr, radix); -if ((cptr == tptr) || ((max > 0) && (val > max))) +if ((cptr == tptr) || (val > max)) *status = SCPE_ARG; else { while (sim_isspace (*tptr)) tptr++; diff --git a/sim_defs.h b/sim_defs.h index cee3d42e..7e9dc836 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -231,9 +231,11 @@ typedef unsigned long t_uint64; #if defined (USE_INT64) /* 64b data */ typedef t_int64 t_svalue; /* signed value */ typedef t_uint64 t_value; /* value */ +#define T_VALUE_MAX 0xffffffffffffffffuLL #else /* 32b data */ typedef int32 t_svalue; typedef uint32 t_value; +#define T_VALUE_MAX 0xffffffffUL #endif /* end 64b data */ #if defined (USE_INT64) && defined (USE_ADDR64) /* 64b address */ diff --git a/sim_timer.c b/sim_timer.c index bcbe7010..4159f3a1 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -1313,7 +1313,7 @@ t_value stop_time; if (cptr == NULL) return SCPE_ARG; -stop_time = get_uint (cptr, 10, 0, &r); +stop_time = get_uint (cptr, 10, T_VALUE_MAX, &r); if (r != SCPE_OK) return r; if (stop_time <= (t_value)sim_gtime())