List of commands, of the form "info item", showing documentation for several
programming tools:
info nasm (for the assembler)
info gdb (for the debugger)
info emacs (for the editor)
info make (for the Makefile)
Assembling .asm files
Suppose you want to assemble a file called "file.asm" and generate an executable
called "file" and an annotated listing of the machine code called "file.lst".
At the command prompt: Type the command "make -e EXECUTABLE=file"
and hit enter.
Within the editor emacs: Open the file "file.asm" in emacs, from the "Tools"-menue
choose the item "Compile" and hit enter if asked.
Examples
Donwload the file examples.tgz and unpack it
with the command "tar xfz examples.tgz".
You will find the directory "Examples" containing several assembler
programs (cf. Paul A. Carter
).
Debugging
Special debugging commands for the assembly source code: dump_regs, dump_mem,
dump_stack, dump_math (below cf. the textbook "PC Assembly Language")
GNU Debugger gdb with graphical user interface: At the command prompt
type the command "ddd executable &" , where you have to substitute
"executable" by the name of the executable you want to debug, and hit enter.
Then some window with the debugger will open.
GNU Debugger gdb without the graphical user interface:
Invocation:
At the command prompt: Type the command "gdb executable" , where you have
to substitute "executable" by the name of the executable you want to debug,
and hit enter.
Within the editor emacs: Type Alt-x, gdb and enter the name of the executable
when the prompt appears.
Starting the program: Type "g" and hit enter to move the program to the
predefined breakpoint "asm_main" which is the begin of the assembler routine.
Stepping through the program: Type "n" and hit enter.
Customization: you may want to modify the printf command in the file .gdbinit
in your home directory such that stepping through the program produces
the desired output (cf. info gdb). You can reload the file .gdbinit into
your current debugging session by typing "source ~/.gdbinit" and hitting
enter after saving the file .gdbinit.