Return-Path: Date: Thu, 30 Apr 92 14:29:03 EDT Message-Id: <9204301829.AA04307@ncrcol.ncr.com> From: ncrcol!gmb@ncrcol.columbiasc.NCR.COM Subject: pcm patch.3 Here is patch.3 for pcm. The TEST AX instruction was not setting the flags correctly. Additional functionality is also added for REP SCAS instructions. Gary Beihl (gary.beihl@columbiasc.ncr.com) ------ *** /tmp/,RCSt1a08496 Thu Apr 30 14:18:13 1992 --- logical.c Thu Apr 30 14:08:15 1992 *************** *** 195,201 **** unsigned char *i_a9(pc) unsigned char *pc; { FL1L = AL & *pc++; ! FL2H = AH & *pc++; PFLAG1(WBOOL); return pc; } --- 195,201 ---- unsigned char *i_a9(pc) unsigned char *pc; { FL1L = AL & *pc++; ! FL1H = AH & *pc++; PFLAG1(WBOOL); return pc; } *** /tmp/,RCSt1a08617 Thu Apr 30 14:38:22 1992 --- mov.c Thu Apr 30 14:22:08 1992 *************** *** 422,427 **** --- 422,428 ---- unsigned char rep_code; unsigned char *repds; unsigned char *srcptr, *dstptr; + unsigned short opr1; int count, samt; repds = DSEA; again_f2: *************** *** 472,477 **** --- 473,499 ---- dstptr -= count; CARRY = ((unsigned int)AL < (unsigned int)*dstptr); break; + case 0xaf: + count = DIRECTION ? -2 : 2; + dstptr = ESPTR + DI; + ZERO = 0; + FLAGS_OK = 1; + while (CX) { + if (*dstptr == AL && *(dstptr+1) == AH) { + ZERO = 1; + dstptr += count; + DI += count; + CX--; + break; + } + dstptr += count; + DI += count; + CX--; + } + dstptr -= count; + opr1 = *dstptr | (unsigned int)*(dstptr+1) << 8; + CARRY = AX < opr1; + break; default: printf("i_f2: "); return unk_op(pc); break; } *************** *** 590,595 **** --- 612,637 ---- } DI = dstptr - ESPTR; break; + case 0xae: + count = DIRECTION ? -1 : 1; + dstptr = ESPTR + DI; + ZERO = 1; + FLAGS_OK = 1; + while (CX) { + if (*dstptr != AL) { + ZERO = 0; + dstptr += count; + DI += count; + CX--; + break; + } + dstptr += count; + DI += count; + CX--; + } + dstptr -= count; + CARRY = ((unsigned int)AL < (unsigned int)*dstptr); + break; case 0xaf: count = DIRECTION ? -2 : 2; dstptr = ESPTR + DI; *************** *** 611,617 **** opr1 = *dstptr | (unsigned int)*(dstptr+1) << 8; CARRY = AX < opr1; break; ! default: return unk_op(pc); break; } return pc; } --- 653,660 ---- opr1 = *dstptr | (unsigned int)*(dstptr+1) << 8; CARRY = AX < opr1; break; ! default: printf("i_f3: "); ! return unk_op(pc); break; } return pc; }