I have been trying to write c code to overwrite the interrupt vectors on the DS80c400 ( to do the same as the following asm code) EXTRN CODE (com_isr) MOV DPTR, #000023H MOV A, #02H; MOVX @DPTR, A; INC DPTR; MOV A, #BYTE2 com_isr; MOVX @DPTR, A; INC DPTR; MOV A, #HIGH com_isr; MOVX @DPTR, A; INC DPTR; MOV A, #LOW com_isr; MOVX @DPTR, A; i would like to do the same in 'c' but when I get a pointer to the com_isr fuction it is in the "generic pointer" format which is not much use. So any suggestion on how to do this in C?
Two issues: 1) Your assembly code, as given, won't typicall overwrite the interrupt vector table at all --- not unless you have von-Neumann address decoding in the lowermost address range. 2) To get a pointer to xdata instead of generic pointer, cast it to a pointer to xdata. Details in the manual.
"cast it to a pointer to xdata" Or define it as a pointer to xdata in the first place.