From f6f4fe6c3cc3af5c1abb074515434ca34f96a7ee Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Tue, 5 Jun 2018 17:05:25 -0700 Subject: [PATCH] I1620: Fixed bug in select index A (COVERITY) If the CPU is a model 1, then the value of idxb is irrelevant. For tidiness, it should always be 0, but on a model 1, idxe (index enable) is always 0, so idxb is not looked at. Thus, - on a model 1, idxb is set to 0, which is harmless and probably a good thing to do. - on a model 2, idxe is set to 1, and idxb is set to 0, which is the correct behavior. Note that case 0 doesn't need to check for model 2, because clearing idxe and idxb yields the correct settings on a model 1: indexing is off. --- I1620/i1620_cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/I1620/i1620_cpu.c b/I1620/i1620_cpu.c index dc0e80d1..28f396e9 100644 --- a/I1620/i1620_cpu.c +++ b/I1620/i1620_cpu.c @@ -1,6 +1,6 @@ /* i1620_cpu.c: IBM 1620 CPU simulator - Copyright (c) 2002-2017, Robert M. Supnik + Copyright (c) 2002-2018, 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"), @@ -26,6 +26,7 @@ This CPU module incorporates code and comments from the 1620 simulator by Geoff Kuenning, with his permission. + 05-Jun-18 RMS Fixed bug in select index A (COVERITY) 23-Jun-17 RMS BS should not enable indexing unless configured 15-Jun-17 RMS Added more information to IO in progress message 26-May-17 RMS Added deferred IO mode for slow devices @@ -975,7 +976,7 @@ while (reason == SCPE_OK) { /* loop until halted */ break; case 1: if ((cpu_unit.flags & IF_IDX) != 0) /* indexing present? */ - idxe = 1; idxb = 0; /* index band A */ + idxe = 1, idxb = 0; /* index band A */ break; case 2: if ((cpu_unit.flags & IF_IDX) != 0) /* indexing present? */