Interrupts
I finally did it. Interrupts are now a thing.
There are, as of now, three interrupts. Timer, Keyboard and one without purpose.
Each interrupt is allocated 50 bytes of memory at the end of the program.
The standard locations in the Vector Table are 1850, 1900 and 1950.
An instruction with opcode 18 or 0x12 was added for a so called “State Return”. This instruction is mandatory at the end of an interrupt. It will set the PC back to the IRP (Interrupt Return Pointer) and and all the flags back to their saved state.
The screenshot below is a program that utilizes the Timer interrupt to create a simple fade-in animation.
Changes
As for changes, not a lot happened. Small tweaks in the Timer and Keyboard handlers to make them raise interrupts and of course additions to the CPU loop. Main was also slightly changed to make sure everything closes correctly on a System Control 0x01 call. (Shutdown)
What will I work on next?
Frankly, I do not have anything concrete planned. I am thinking of adding a few instructions for interrupts (Specifically Disable, Enable and Raise. For Syscalls in a possible OS maybe?) and overall expanding upon them where I can.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.