Can use ca65 (instead of dasm):
http://wiki.cc65.org/doku.php?id=cc65:atari_2600
Need vcs.h and macro.h from dasm https://github.com/munsie/dasm/tree/master/machines/atari2600 No they don't compile, just start a new vcs.inc that defines all the registers using http://www.classic-games.com/atari2600/specs.html.
Adapt http://www.randomterrain.com/atari-2600-memories-tutorial-andrew-davie-08.html assembly example to ca65.
This produces demo.o
$HOME/other/cc65/bin/ca65 -g -o demo.o demo.s -I.
$HOME/other/cc65/bin/ld65 -C atari2600.cfg -m demo.map -Ln demo.labels -vm demo.o -o demo.bin
Currently this builds a bin, but it doesn't run in stella
It looks identical to http://www.randomterrain.com/files_andrew_davie_sessions/kernel_01.bin except that unused memory isn't filled with 0xff, and in the stella debugger it looks completely different.
look at http://svolli.de/atari2600/28c3intro.tar.bz2 from http://svolli.de/atari2600/