Assembling an HC11 Program

Use an assembler to translate your assembly-language program into machine code. Our assembler is called as11 (note: it only runs on the Linux machines).

To translate a program from assembly code into machine code, you first need to have gotten access to the assembler, as described in Getting Access to CS273 Software. Once you've done this, you can assemble a program with the command

as11 program.asm
(where program.asm is the name of your assembly language program). After you've done this, there will be a new file in your directory, called program.s19 (the file format used by the HC11 tools is called S19 format, and this is called an S19 file. The reason it is called that is that if you look at the file contents, every line starts with either S1 or S9. There is documentation on the file format in the lab notes).

It is also possible to create a listing file, which will show you what machine code has been produced. You do that by giving the command

as11 program.asm -l > program.lst
It is necessary to have a listing file, and to use the .lst extension, to use the tksim11 simulator.