Some 6502 assembler written in javascript.
Labels can be defined by code point (ONE position in source code text) and/or by giving ONE additive formula (which may contain constants and labels).
Label values propagate by means of formula evaluation, by successive, bidirectional propagation through located code, and, as a final resort, after the previously mentioned methods do not gain any more resolution, by using a code-length count algorithm, which can resolve many kinds of label relations, but comes into play with some not totally obvious behaviour: unresolved codepoint labels are collected by sign, to compute the code distance of arbitrary chosen pairings.
All constants are treated as hex values, no support for decimals.
Labels names must not begin with any hex letter (but can be any length, case insensitive matching).
Use less or greater than chars as lo/hi as usual
Currently single-line comments starting with semicolon, only (sorry, didn't find the time...).
Immediate operands for 6502 instructions must be prepended with hash.
In addition to the bare 6502 instructions, the following mnemonics are supported:
.section int , plain name stringStarts a new file. Integer parameter meanings: 0=no export, 1=normal sequential file, 2=PRG file (with start-adr prepended))
.copyInsert bytes from between the two code point labels.
.dba comma separated list of data bytes to be included. Empty arguments become upper 8 Bits of provious argument. ASCII strings supported as usual.
.dbcbmLike .db, but with ASCII stings converted to C64 screen codes (assuming rom charset).
.dbpetLike .db, but with ASCII stings converted to PETSCII codes (for filenames,...).
.fillParameter list like .db, but the pattern defined in this way is repeated and/or truncated to fill "the gap". "The gap" is to be defined by locating both sides of the instruction, so it cannot be used in position independet code.
.fillcbmJust like .fill with .dbcbm parameters.
.fillpetJust like .fill with .dbpet parameters.
.filf"fill from", just like .fill with .copy parameters.
.rfill, .rfillcbm, .rfillpet, .rfilfJust like .fill, but with data aligened to end instead of the beginning of the gap.
.dez int1,int2,int3insert int1 digit ASCII=PETSCII representation of int3. int2=zero-fill flags (20=space or zero, 10=trail or lead).