When trying to call the builtin api functions of the Atmel AT89C5131 I get no results - the call simply returns the input values instead of the requested register values. The function doing the call is: ---------------------------------------------------
#define MSK_AUXR1_ENBOOT 0x20 #define MAP_BOOT AUXR1 |= MSK_AUXR1_ENBOOT; #define UNMAP_BOOT AUXR1 &= ~MSK_AUXR1_ENBOOT; typedef unsigned char Uchar; Uchar data api_command _at_ 0x1C; Uchar data api_value _at_ 0x1D; Uchar data api_dph _at_ 0x1E; Uchar data api_dpl _at_ 0x1F; Uchar __api_fct_set_1 (Uchar _R1, Uint16 _DPTR) small { bit ea_save; ea_save = EA; EA = 0; api_dph = (_DPTR >> 8); api_dpl = (_DPTR & 0xFF); api_command = _R1; api_value = _R1; MAP_BOOT; __API_FLASH_ENTRY_POINT(); UNMAP_BOOT; EA = ea_save; /* restore interrupt state */ return (api_value); }
__API_FLASH_ENTRY_POINT: PUSH AR2 PUSH AR4 PUSH AR6 LCALL 0FFF0h POP AR6 POP AR4 POP AR2 Ret