A FORTH ASSEMBLER FOR THE 6502#

by William F. Ragdale

Source: 6502 Assembler in Forth

INTRODUCTION#

This article should further polarize the attitudes of those outside the growing community of FORTH users. Some will be fascinated by a label-less, macro-assembler whose source code is only 96 lines. Others will be repelled by reverse Polish syntax and the absence of labels.

The author immodestly claim that this is the best FORTH assembler ever distributed. It is the only such assembler that detects all errors in op-code generation and conditional structuring. It is released to the public domain as a defense mechanism. Three good 6502 assemblers were submitted to the FORTH Interest Group but each had some lack. Rather than merge and edit for publication, I chose to publish mine with all the submitted features plus several more.

Imagine having an assembler in 1300 bytes of object code with:

  1. User macros (like IF,UNTIL,) definable at any time.
  2. Literal values expressed in any numeric base, alterable at any time.
  3. Expressions using any resident computation capability.
  4. Nested control structures without labels, with error control.
  5. Assembler source itself in a portable high level language.

(work in Progress)