• Thanks for all the good ideas.

    It would be nice to be able to use the internal wires between the timers instead of an external wire. This is done by setting up one timer as a master with output TRGO and the second timer as a slave with input on the appropriate line ITR0..ITR3. The problem is telling the Javascript code when the timer process is finished so that the Javascript can peek at the results.
    From the interpreter perspective with a finite amount of memory, adding code to cover all possible conditions results in lower memory limits for user code that doesn’t use all the features. It makes sense to have the user add the code to handle the interrupt.
    I was looking at the inline assembler page.
    http://www.espruino.com/Assembler#line=195,196
    For an interrupt service routine (ISR):
    Disable interrupts
    Clear the interrupt flag
    Enable interrupts
    Queue something to let Javascript know
    Return or is it return from interrupt (as seen in some processors)
    So this is placed in spare memory as you outlined and the address written to the interrupt table.
    With the code for one such ISR as a pattern, a short function could be written
    Function codeISR(InterruptNum,registerAddr,bitnum,value)
    The function would then take the example ISR and insert the parameters and console.log the code to be used for the new ISR. These could be pasted into the user program that needs such the ISR function.

    As far as to which Javascript verb to use do E.on('IRQ15', function() { ... })
    or setWatch or some other verb I’ll leave that up to you.

    Do you have a link to obtain a copy of the assembler?
    What is the opcode for disable and enable interrupt?
    Does the ARM use a special return from interrupt? If so what is the opcode?
    How to queue the Javascript?

About