The assembler I wrote for my Forth for the Commodore 64 is also based on Ragsdale's assembler. I rewrote M/CPU and the index table is ten bytes smaller. I added range checking for the instructions that compile a branch. One change I'm thinking about is removing the comma's at the end of the opcode and control structure names. On the other hand, the code words for the system are written with the comma's in the names and I'd have to rewrite it.
I squeezed it down a bit in PETTIL too. The best reason to leave the commas at the end of the opcodes is that it's how most other RPN Forth Assembly language is written.
Does anyone know of any bugs in Ragsdale's assembler?
Blazin' Forth's assembler is based on Ragsdale's and the creator of Blazin' Forth said the following.
Scott Ballantyne wrote:
Actually, there was only one bug ever reported from Blazin' Forth, and I found that myself and uploaded a patch. To tell the truth, there is one other bug in that program, I discovered it years later. It's actually a bug in the assembler - there was a garbage line that should have triggered an error but didn't, it assembled garbage. But the nature of the bug is such that it actually is only triggered extremely rarely. No one has ever reported it. Hehe!
I don't know if he was referring to:
1) The assembler he used to build Blazin' Forth and the bug is in Blazin' Forth.
2) The assembler he included with Blazin' Forth which is based on Ragsdale's.
( d1 d2 -- f )
CODE D= TOS 0 + LDA TOS 4 + CMP 1$ BNE
TOS 1 + LDA TOS 5 + CMP 1$ BNE
TOS 2 + LDA TOS 6 + CMP 1$ BNE
TOS 3 + LDA TOS 7 + CMP 1$ BNE
POP3-TRUE JMP
1$: POP3-FALSE JMP END-CODE
No commas. I don't remember any in Forth Dimensions magazine using commas either; but I'd have to look through a lot of old issues to make sure that's true.
Interesting. I just got an idea on how to write an editor tool to automate the task of changing the comma terminated version of the mnemonics and control flow words to a version without commas yet it will not affect any other words with commas. I think I'll get rid of those commas after all.