- parts of in-built Pascal units such as SysUtils that have been written in in-line assembler;
- the CPU window available in Delphi;
- the assembler window in Lazarus.
CPU Window in Delphi
In Delphi, press F7 to start stepping through a program then, from the View menu select Debug Windows then CPU (or use the shortcut key combination Ctrl+Alt+C).
Assembler Window in Lazarus
In Lazarus, press F7 to start stepping through a program then, from the View menu select Debug windows then Assembler to give you the AT&T syntax used by Lazarus.
This tutorial covers only assembly language for Intel processors. We include both Intel syntax, used in Delphi and provided for in Lazarus, and AT&T syntax which is the default for Lazarus. In order to compile code for so many platforms, Lazarus translates Pascal to AT&T assembler code and then performs the final stage of the compilation according to the requirements of the target processor.
The tutorial has a Getting Started section with some easy programs for you to try and a minimum of theory. The Advanced Assembler section takes a more detailed look at registers and addressing modes and includes examples that are more difficult to understand. The final section applies the knowledge to the encryption and decryption of files.
Several simulator programs such as GASP are available for teaching purposes, and may be easier to understand than the code for your processor. If you are taught how to use a simulator, try in-line assembler afterwards.
Follow the numbered links to the sections described above. See also programs Encrypt (by Peter Hearnshaw) and CollatzASM (by Felix Thompson) for further examples of the use of in-line assembler and Peter's teaching aid GASP to help you to learn assembler.