Close

Adding Interrupts (without hardware)

A project log for 8 Bit TTA Interpreter

TTA (Transport Triggered Architecture) is very simple CPU type.

agpcooperagp.cooper 05/22/2018 at 07:270 Comments

Interrupts

One way to add interrupts is for the interpreter to check each time it is called. This slows things down and imposes a condition. No process should "block" the interpreter.

An example of a blocking sunroutine is "getchar". It waits until a character arrives before returning. A better way is for the subrountine to fail and then to retry.

To set up interrupts I need to add:

The best place to put these system variables in the CPU MODEL area:

You may also notice I have abandoned the "i8080 lite" CPU Model, the model is now more like a stack CPU with a Return Pointer (RP) and a Data Pointer (DP). Next will likely be a Top Of (data) Stack, "TOS". If you have not worked it out I am considering a micro-forth style operating system.

Okay, here is the interpertrer code:

All it does is read the interrupts and if anything is high (active) it calls the ISR subroutine to work it out. Initially the MASK is set all on (0xFF) but the ISR is diabled, it just calls _INTERP (okay I just saw the coding error where I called INTERP rather than _INTERP!).

The next bit of work is to look at "getchar" and "putchar", and some sort of terminal (hardware) interface.

AlanX

Discussions