This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

overwriting ds80c400 interrupt vectors

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?

Parents
  • Thanks for the feeback...

    1) The original code snipet I included does work. The DS80C400 is normally used in von-Neumann mode...required by its boot rom.

    2) casting it with xdata converts the address to a 16 bit address, i need the 24 bit address (the ds80c400 has a linear 16M - 24 bit address map). thus the byte 2 in the asm code.

    I have also tried casting the pointers with "const far" and "far" but they still give me the generic pointers to my function rather than a linear 24 bit address.

Reply
  • Thanks for the feeback...

    1) The original code snipet I included does work. The DS80C400 is normally used in von-Neumann mode...required by its boot rom.

    2) casting it with xdata converts the address to a 16 bit address, i need the 24 bit address (the ds80c400 has a linear 16M - 24 bit address map). thus the byte 2 in the asm code.

    I have also tried casting the pointers with "const far" and "far" but they still give me the generic pointers to my function rather than a linear 24 bit address.

Children