interrupt system throwing NPE

Issue #11 resolved
William Roberts created an issue

$ ./out/exe/miniat_console interupts.bin PANIC -- Uncaught Exception Error 9 -- Program Counter Queue Empty in file: out/vm/src/miniat_pc.c in function: m_pc_remove_first on line 66

.const IVT_XINT_0 0x00001AFA
.const IVT_XINT_1 0x00001AFD

.address 0x2000

!main
    MOVI  r1, !XINT0_IHR
    MOVI  r2, !XINT1_IHR
    STOR r1, [IVT_XINT_0]
    STOR r2, [IVT_XINT_1]
    INT (r0 + 32)
!XINT0_IHR
    INT (r0 + 33)
    NOP
    NOP
    NOP
    NOP
!XINT1_IHR
    INT (r0 + 32)

Comments (1)

  1. William Roberts reporter

    See Pull request #25 where this is fixed.

    In short, an invalid IVT can cause the machine to reset. When the machine reset the PC queue was never reinitialized to the beginning of flash. On the next clock, when fetch went to get the PC, the queue was empty.

  2. Log in to comment