Table of Contents Previous topic Next topic
The Extension Interface->Variant Specific Interface Calls->GetRegisters()
extern "C" LONG GetRegisters(LONG nExtensionState)
This call allows the extension to set the register names and addresses that will be displayed in the registers window of the Virtual Workshop.
The extension should return a struct tagRegisters* that points to the start of an array of structures containing information on the registers to be displayed.
If an extension does not wish to handle this call then is should return NULL.
struct tagRegisters
{
char* pszName;
BYTE nWidthInBits;
BYTE nSfrAddress;
};
pszName | This points to the name of the SFR that will be displayed in the registers window. For the last structure in the array, this element should be NULL. |
nWidthInBits | This contains the width in bits of the SFR and will be either 8 or 16. |
nSfrAddress | This contains the address of the SFR. For 16 bit SFR's is should contain the address of the low byte. |
struct tagRegisters regAT89C52[] = {
"ACC", 8, 0XE0,
"B", 8, 0XF0,
"TCON", 8, 0X88,
"T2CON", 8, 0XC8,
"T2MOD", 8, 0XC9,
"TMOD", 8, 0X89,
"TH0", 8, 0X8C,
"TL0", 8, 0X8A,
"TH1", 8, 0X8D,
"TL1", 8, 0X8B,
"TH2", 8, 0XCD,
"TL2", 8, 0XCC,
"RCAP2H", 8, 0XCB,
"RCAP2L", 8, 0XCA,
"SCON", 8, 0X98,
"SBUFi", 8, 0X99 - 0X80,
"SBUFo", 8, 0X99,
"P0", 8, 0X80,
"P0pin", 8, 0X80 - 0X80,
"P1", 8, 0X90,
"P1pin", 8, 0X90 - 0X80,
"P2", 8, 0XA0,
"P2pin", 8, 0XA0 - 0X80,
"P3", 8, 0XB0,
"P3pin", 8, 0XB0 - 0X80,
"IE", 8, 0XA8,
"IP", 8, 0XB8,
"PCON", 8, 0X87,
"PSW", 8, 0XD0,
"SP", 8, 0X81,
"DPTR", 16, 0X82, // the address of the low byte
0 // terminator
};