3 ms·
For context, Bill Ragsdale (note the "s"!) wrote this article for Forth Dimensions in 1981; it was published in the January/February 1982 issue. Might it have
by kragen 15y ago
For context, Bill Ragsdale (note the "s"!) wrote this article for Forth Dimensions in 1981; it was published in the January/February 1982 issue. Might it have been more important to you if you were doing self-hosted development on a 6502?
I guess you're saying you don't like the reverse polish syntax:
.A ROL, --> ROL A
1 # LDY, --> LDY #1
DATA ,X STA, --> STA DATA,X
DATA ,Y CMP, --> CMP DATA,Y
6 X) ADC, --> ADC (06,X)
POINT )Y STA, --> STA (POINT),Y
VECTOR ) JMP, --> JMP (VECTOR)
That's understandable, although I think it's not too hard to learn to read that. It would probably take another page or two for a conventional parser. On the other hand, I think the environment he's describing has some big advantages over a conventional assembler, other than just code size:
1. The macro system is a full-fledged Turing-complete programming language, not some crippled text-substitution thing kludged onto the side of the assembler.
2. You can write loops and conditionals in it without labels, which makes it a little closer to C than to assembly in the language level, in my book. To me, that makes it more readable, rather than less.
3. You can test your assembly-language routines interactively as you write them, as if you were programming in DDT, but without losing the ability to go back to your source code.
In the long run, though, these potential advantages lost out to more traditional IBM-punched-card-style assembly languages, and mostly to C. I don't really understand why. Maybe because the successful companies already weren't doing their 6502 development self-hosted?
- justincormack 15y agoMakes more sense with the date! Perhaps an ARM port would be useful...
- KGRGreer 15y agoHow about a Forth Arm Assembler and Disassembler: http://yxit.co.uk/source/#ARM%20Assembler http://yxit.co.uk/source/#ARM%20Assembler
- kragen 15y agoI imagine that could be very useful, but the code is pretty bad. Take a look at the REGISTER word in http://yxit.co.uk/source/forth/arm-asm.f http://yxit.co.uk/source/forth/arm-asm.f. It contains 25 lines of code! And they're full of magic numbers and stack operations!