diff --git a/IBM360/ibm360_cpu.c b/IBM360/ibm360_cpu.c index afced65..de968fa 100644 --- a/IBM360/ibm360_cpu.c +++ b/IBM360/ibm360_cpu.c @@ -2963,7 +2963,10 @@ save_dbl: goto supress; addr1++; if (rval[i] != src1) { - cc = (rval[i] < src1)? 1: 2; + if ((uint32)rval[i] > (uint32)src1) + cc = 2; + else + cc = 1; break; } } @@ -3532,8 +3535,10 @@ save_dbl: break; } if (dest != desth) { - dest = dest - desth; - cc = (dest & MSIGN) ? 1 : (dest == 0) ? 0 : 2; + if ((uint32)dest > (uint32)desth) + cc = 2; + else + cc = 1; break; } if (src1 != 0) { diff --git a/IBM360/ibm360_scom.c b/IBM360/ibm360_scom.c index 039c75a..e7fd577 100644 --- a/IBM360/ibm360_scom.c +++ b/IBM360/ibm360_scom.c @@ -265,6 +265,15 @@ t_stat scoml_srv(UNIT * uptr) int cmd = uptr->CMD & 0xff; uint8 ch; + if (scom_ldsc[unit].conn == 0 && cmd != 0x4) { + /* If no connection yet, pretend unit is powered off. + ATTN & DE at connection will revive activity. */ + uptr->SNS |= SNS_INTVENT; + uptr->CMD &= ~0xff; + chan_end(addr, SNS_CHNEND|SNS_DEVEND|SNS_UNITCHK); + return SCPE_OK; + } + if ((uptr->CMD & (RECV|DATA)) != 0) { sim_activate(uptr, 200); return scom_readinput(uptr); @@ -407,6 +416,7 @@ t_stat scom_scan(UNIT * uptr) scom_sendoption(line, ln, DO, OPTION_EOR); line->CMD |= ENAB|DATA|INIT1; line->CMD &= ~(RECV|SEND); + line->SNS = 0; sim_activate(line, 20000); }