Search code examples
delphioptimizationassemblybasm

Good Resources for using Assembly in Delphi?


Question

Are there any resources for learning how to use assembly in Delphi?

Background Information

I've found and read some general assembly and instruction set references (x86, MMX, SSE etc). But I'm finding it difficult to apply that information in Delphi. General things like how to get the value of a class property etc.

I would like to have the option to use assembly when optimising code.

I understand:

  • It will be difficult to beat the compiler.
  • High-level optimisation techniques are much more likely to increase performance by several orders of magnitude over low-level assembly optimisations. (Such as choosing different algorthims, caching etc)
  • Profiling is vital. I'm using Sampling Profiler for real-world performance analysis and cpu cycle counts for low-level details.

I am interested in learning how to use assembly in Delphi because:

  • It can't hurt to have another tool in the toolbox.
  • It will help with understanding the compiler generated assembly output.
  • Understanding what the compiler is doing may help with writing better performing pascal code.
  • I'm curious.

Solution

  • Here is a resource that could be helpful...

    www.guidogybels.eu/docs/Using%20Assembler%20in%20Delphi.pdf

    (I wanted to add a comment to @Glenn with this info, but am forced to use the Answer mechanism as I am New to this forum and not enough Reps...)