Thanks for the links :). I was pondering a little over what you wrote.
About the Keyboard interrupt routine from the Amiga Machine Code Course. You have really underscored that the routine cannot stand alone, since there is no handshake. All in all, it's very hackish
The routine only works, because it's daisy chained to the system keyboard handler, via the last jump. So the first interrupt handler just acts as a relay, that toggles the power LED, while the system keyboard handler takes care of the handshake.
However, I found something else that is a huge potential problem. It's about the last jump. The jump address is set by the program rewriting itself, and then copying part of the program to an allocated space of memory, which is then hooked into the exception vector table.
At first, I thought that this was an interesting technique, and it surely is, but it's very problematic. Here's a quote from
Mike Morton written in BYTE magazine, September 1986.
Self-modifying code is especially bad for 68000 programs that may someday run on the 68020, because the 68020's instruction cache normally assumes that code is pure.
The
68020 introduced an L1 cache of 256 bytes, and I can imagine that any program that relies on self-modification, will risk running into big problems with memory and cache going out of sync.
Well, these was just my thoughts on the issue. The
Amiga Machine Code course was originally written in 1989, and had a learn-fast-and-skip-details mindset. Just learn enough, to set you on the path of learning more yourself. For me, it has been a really good learning experience.
I first started my assembler journey by reading
The Elements of Computing Systems. The book starts by you building all hardware with nand gates, which is followed by you building a virtual machine on top of which you build a compiler for a high level language called Jack. The keystone project is to build a game
The book also have a companion site, callled
nand2tetris.org with slides and notes.
Stay healthy
Ostatnia aktualizacja: 18.04.2020 12:43:04 przez MarkWrobel
Ostatnia aktualizacja: 18.04.2020 12:46:16 przez MarkWrobel