Monday, 13 April 2020

Game #7 : Frogger II

So, done a bit of work on Frogger, and it now mostly works. You can play the game, there are just no sound effects and the turtles don't dive.

So I'll finish that this morning, and will do Space Invaders (aahhh the classics :) ).

Then I will spec this quasi FORTH that's been bouncing round my head for a few days, and write that.

Hopefully makes the assembler almost null and void. Though it's only a small amount of code, having an orthogonal instruction set gives you a simple assembler.

Most of the work is actually macros like push and pop (you can write push r0,r1,r2,r3,link and it generates 6 instructions in the right order) which are very useful, and some clarifying ones. For example carry testing is done using the "skip if carry matches operand bit 0" instruction (this sounds completely insane but it actually works very well) but you almost never use that because macros make the far clear skc sknc sklt skge, for carry testing and subtraction comparisons. There's a similar thing for register sign/value test skz sknz skp skm. Jumps branches and Returns are all done with the same instruction (branch-link which does Rx = PC, PC = operand) but it's completely unreadable in source, so there are jmp, jsr, ret instructions which compile to the relevant opcodes.

No comments:

Post a Comment

Breaking change

We all make mistakes. One early mistake I made was copying (partly) the old thing in Microsoft BASIC where you didn't have to declare ...