I was sitting around at Lake Eildon one weekend with nothing much to do apart from swim and play with Linux, and I decided to throw together a small assembler for the 6502 chip, in Perl.
The source code is here.
Some sample code to compile with it:
ORG 49152 LDA #0x00 loop: STA 53280 ADC #0x01 CMP #0x00 BNE [loop] RTS
The program spits out the binary with the destination address (LSB first) as the first two bytes - it can then be loaded straight into VICE, a Commodore 64 emulator.
Currently the program can only handle implied, immediate, absolute (+ X & Y), and relative addressing modes. I couldn't remember how the other modes worked.
./asm.pl prog.asm > prog.bin