


/*
 *
 * This function updates sign, zero, parity flags based on the byte recieved.
 *
 */

 static int nibblemap[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};

 int setrf(int data)        
 {
  rf[1] = (data == 0);
  rf[0] = (data > 0x7f);
  data &= 0xff;
  rf[5] = ( (nibblemap[data & 0xf] + nibblemap[(data >> 4) & 0xf]) % 2 == 0);
  return(0);
 }
