Пример #1
0
unsigned int PerformSFM(const unsigned int opcode)
{
	unsigned int __user *pBase, *pAddress, *pFinal;
	unsigned int i, Fd, write_back = WRITE_BACK(opcode);

	pBase = (unsigned int __user *) readRegister(getRn(opcode));
	if (REG_PC == getRn(opcode)) {
		pBase += 2;
		write_back = 0;
	}

	pFinal = pBase;
	if (BIT_UP_SET(opcode))
		pFinal += getOffset(opcode);
	else
		pFinal -= getOffset(opcode);

	if (PREINDEXED(opcode))
		pAddress = pFinal;
	else
		pAddress = pBase;

	Fd = getFd(opcode);
	for (i = getRegisterCount(opcode); i > 0; i--) {
		storeMultiple(Fd, pAddress);
		pAddress += 3;
		Fd++;
		if (Fd == 8)
			Fd = 0;
	}

	if (write_back)
		writeRegister(getRn(opcode), (unsigned long) pFinal);
	return 1;
}
Пример #2
0
static unsigned int PerformSFM(const unsigned int opcode)
{
   unsigned int i, Fd,
     write_back = WRITE_BACK(opcode);
   target_ulong pBase, pAddress, pFinal;

   pBase = readRegister(getRn(opcode));
   if (ARM_REG_PC == getRn(opcode))
   {
     pBase += 8;
     write_back = 0;
   }

   pFinal = pBase;
   if (BIT_UP_SET(opcode))
     pFinal += getOffset(opcode) * 4;
   else
     pFinal -= getOffset(opcode) * 4;

   if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase;

   Fd = getFd(opcode);
   for (i=getRegisterCount(opcode);i>0;i--)
   {
     storeMultiple(Fd,pAddress);
     pAddress += 12; Fd++;
     if (Fd == 8) Fd = 0;
   }

   if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
   return 1;
}