From ec9c746ca7830059c4e6fdd9c392a0bb6f4a9192 Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Sun, 21 May 2017 21:39:10 -0700 Subject: [PATCH] I1620: Changed fprint_val to handle undefined opcodes on stops --- I1620/i1620_sys.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/I1620/i1620_sys.c b/I1620/i1620_sys.c index 766aca4c..194f8943 100644 --- a/I1620/i1620_sys.c +++ b/I1620/i1620_sys.c @@ -1,6 +1,6 @@ /* i1620_sys.c: IBM 1620 simulator interface - Copyright (c) 2002-2015, Robert M. Supnik + Copyright (c) 2002-2017, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -23,6 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Robert M Supnik. + 18-May-17 RMS Changed fprint_val to handle undefined opcodes on stops 19-Mar-12 RMS Fixed declaration of CCT (Mark Pizzolato) */ @@ -388,8 +389,13 @@ for (i = 0; opcode[i].str != NULL; i++) { /* find opcode */ ((opfl != I_1E) && (opfl != I_0E)))) break; } -if (opcode[i].str == NULL) +if (opcode[i].str == NULL) { /* invalid opcode */ + if ((sw & SIM_SW_STOP) != 0) { /* stop message? */ + fprintf (of, "%02d", op); /* print numeric opcode */ + return -(INST_LEN - 1); /* report success */ + } return SCPE_ARG; + } if (I_GETQP (opfl) == I_M_QNP) /* Q no print? */ qmp = 0;