getCpuReg

Syntax

int getCpuReg(int nr)

Arguments

nr
The number of the specified CPU register to retrieve the value from, where 0 = edi, 1 = esi, 2 = ebp, 3 = esp, 4 = ebx, 5 = edx, 6 = ecx, 7 = eax, 8 = eip

Return

The value stored in that CPU register as an integer.

Description

Retrieves the value currently stored in a CPU register.

Example

%fml

ForEveryTile:
{
  Info("Value of CPU Register edi = %d", getCpuReg(0));
  Info("Value of CPU Register esi = %d", getCpuReg(1));
  Info("Value of CPU Register ebp = %d", getCpuReg(2));
  Info("Value of CPU Register esp = %d", getCpuReg(3));
  Info("Value of CPU Register ebx = %d", getCpuReg(4));
  Info("Value of CPU Register edx = %d", getCpuReg(5));
  Info("Value of CPU Register ecx = %d", getCpuReg(6));
  Info("Value of CPU Register eax = %d", getCpuReg(7));
  Info("Value of CPU Register eip = %d", getCpuReg(8));
  return true;
}

See Also

(finit)?, (fstsw)?, (fstcw)?, (fldcw)?

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.