Important Note! John Wiley Publishing, ISBN Far from a minor touchup, the third edition 3E, as we say in the trade was a near-total rewrite. DOS is gone for good, and the entire book now focuses on assembly programming for x86 Linux, using free and open source tools that include the NASM assembler, the ld linker, the Kate editor, the Bless hex editor, and the Insight graphical front end to the foundational GNU debugger, gdb.
|Published (Last):||5 October 2005|
|PDF File Size:||5.7 Mb|
|ePub File Size:||12.82 Mb|
|Price:||Free* [*Free Regsitration Required]|
Note: Jeff Duntemann is not personally liable for anything that appears here! As time allows and a felt need arises, I may expand this site into a forum. Any errors on this page are entirely unintentional. Therefore, use this information at your own risk. If you have any corrections or helpful additions to the tips on this site, please email me at asmhelp at ishipaco dot com.
Question One: or go to the second question , or more tips. This error message occurs on computers with a bit CPU and operating system. This problem should not occur on computers with bit CPUs. Note that -f elf is the same as -f elf32—they both yield bit object files.
However, the linker the ld command on a bit computer has default options set which makes it expect object code assembled to run on a bit CPU. Also note that one of the formats should be elf Using this assembler option instead of elf in the nasm command line will cause nasm to produce bit object code, which the linker on a bit machine wants by default. Two Solutions: With all this knowledge now in hand, we can see that there are two basic solutions to this problem: Assemble and link to produce a bit executable.
This tells the linker to expect a bit object module and to output a bit executable file. In the second case we changed the nasm option from -f elf to -f elf64, which will cause nasm to create an object module with bit code. Warning: Although the eatsyscall and earlier programs can be successfully assembled, linked and run as either bit or bit programs, this is not the case with most of the programs later in the book, beginning with the Hexdump3 program starting on pg. This is the first program in the book that uses push and pop instructions.
Code containing these instructions will not assemble as bit programs without errors. The reason for this involves a conflict in register sizes. The program code, as written e. Of course, the source code could be changed to use bit operands, but that assumes a level of expertise that most readers are not likely to have.
Question Two: or go to the first question , or more tips. The second problem with which Jeff is currently dealing, is the fact that he was blindsided by the recent release of Linux Ubuntu For unknown reasons, the Insight debugger, which Jeff uses throughout his book, was dropped from the Ubuntu Further, an Insight package is not to be found on any of the standard repositories that Ubuntu However, there are several work-arounds for this problem.
In particular, see Solution Three below for a way to actually install Insight on Ubuntu In my case, I installed Ubuntu 9. It would appear that the problem is limited to the new However, the Insight debugger was not installed by default, but was available in a standard repository and installed easily with Synaptic Package Manager. Warning: If you are currently running Ubuntu When I did that, the 9. Although the menu list still worked, when I booted into any of my Also, although the Ubuntu desktop appeared and worked normally, all of the console windows accessed by using ctrl-alt-F were also unreadable and unusable because of text being displayed as colored pixels.
This problem was caused because the boot process was using the newly installed legacy version of grub 0. I fixed this by booting into the Ubuntu 9. After that, everything worked normally again. Solution Two: Use the Kdbg debugger with Ubuntu Kdbg has been working OK on my Ubuntu The faults that Jeff cites in his book seem to have been fixed in the latest version of Kdbg and Ubuntu.
The memory window works fine for me. Jeff gives an introduction to Kdbg in his book. In some cases you might want to experiment using GDB direct from the command line. Note: To be honest, I have encountered some strange quirks in Kdbg.
Sometimes simply "touching" the executable file i. Why this problem exists and this fix works are a complete mystery to me. On my machine, the source code, register, memory and terminal output windows pop up. If, however, I set a breakpoint in the code at the first executable line of code following the first nop instruction and run the code down to the breakpoint, I can then close the output window and Kdbg will continue to run with no problems. Go figure.
Try this technique if you experience a similar problem. He recently wrote Jeff and provided a way to install Insight on Ubuntu He reports that he has successfully implemented this fix on over machines in his lab.
I have also had complete success installing Insight on my own system using his method. Gareth actually provided two methods for the installation. The first, more complex, approach involves compiling from source code.
The second method uses a shell script he wrote which handles the entire process transparently. Insight should be installed and ready to run! Note: Gareth mentions that this installation downloads a custom archive from his personal website at the university and this will be maintained for some time.
He will update to the latest versions when he can. Be aware that this is a major installation which involves downloading about ninety files. The compilation process also takes considerable time, so be patient. Therefore we will need to compile GDB and in order to do so, we will need to download a whole bunch of libraries.
After running the shell script and completing the installation, it should be obvious that this was never going be a "simple" fix. Return to top of page More Tips: Configuring the Konsole terminal in Kate using the Gnome desktop: Jeff gives instructions for configuring the Konsole terminal for use with the Kate editor on pg.
Konsole is the default terminal for the KDE desktop but, if you are using the Gnome desktop, the default terminal is different and you need to add an extra step to configure Konsole. This will launch the default Gnome terminal. This will open a Konsole terminal window.
Follow the Author
Assembly Language: Step-By-Step
Assembly Language Step-by-Step: Programming with Linux, 3rd Edition
Assembly Language: Step-by-Step in PDF