With an editor you can write your assembly programs, like several examples on this homepage. You have to compile them into Intel-Hex-files with an assembler. Below you can find an freeware assembler.
Metalink 8051-assembler
and here a nice one
ASEM-51
and what about
SB-Assembler