Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Z80 interrupt vector table initiation

CVINK1925
2012-10-19
2013-03-12
  • CVINK1925
    CVINK1925
    2012-10-19

    I've tested succesfully the following code with sdcc for Z80 to initialize the INTERRUPT VECTOR JUMP TABLE:

    *
    *
    * name: inicializa tabla de vectores
    * @param
    * @return
    * esta funcion inicializa la tabla de vectores
    * de interupción (modo 2) en la posición de memoria
    * 0x7F00 (256 bytes) hasta 0x7FFF (límite de RAM)
    */
    void inictabla(void)
    {
       __asm
        di
        /*ld hl,(#0x7F00)*/
        ld hl,#0x7F00 /*comienzo tabla vectores en 0x7F00*/
        ld a,h
        ld i,a
        ld iy,#_pio1b
        ld (#0x7F20),iy /*vector int 0x20*/
        ld iy,#_pio2b
        ld (#0x7F22),iy /*vector int 0x22*/
        ld iy,#_siorx
        ld (#0x7F24),iy /*vector int 0x24*/
        ld iy,#_cuentalospasos
        ld (#0x7F32),iy /*vector int 0x32*/
    ld iy,#_temporiza1s
    ld (#0x7F34),iy /*vector int 0x34*/
        ei
       __endasm;  

    }

    The interrupt routines are the following:

    void pio1b (void) __interrupt (0x20)
    void pio2b (void) __interrupt (0x22)
    void siorx (void) __interrupt (0x24)
    void cuentalospasos (void) __interrupt (0x32)
    void temporiza1s (void) __interrupt (0x34)

     
  • CVINK1925
    CVINK1925
    2012-10-19

    The Z80 simulator I've used is:

    Oshon Software Z80 Simulator IDE.v9.45

    very complete and is at:

    http://www.oshonsoft.com/