Section 9.4: A program with a loop (Frame 5)                     [prev][home][next]

Compilers have to produce code that is very similar to the above, based on what instructions are available in the target computer. Many UNIX C compilers will let you see the assembler code by specifying the -s option on the compile command. With gcc, the popular GNU C compiler, using -s causes the compiler to write a file ending in .s which contains the assembler code:

%  gcc -s myprog.c
%  cat myprog.s

Unfortunately, most real assembler languages are much more complicated than the CSC-1, so you would probably be dismayed by all the extra junk in the assembler program.