Using assembly-language in your code

PowerBASIC provides a number of ways in which you can use assembly-language. You can write the whole program using the Inline Assembler. You can write entire Subs, Functions, Methods, and Properties in assembly-language, or, you can write individual lines of code in assembler, surrounded by BASIC statements. This ability to intermix BASIC and assembly-language, line by line, makes PowerBASIC's Inline Assembler a very powerful tool when optimal performance is an essential issue.

To write good assembler code, you must be aware of certain items:

· | The types of variables supported by PowerBASIC

· | How those variables are stored in memory

· | How to use variable names in your Inline Assembler routines

· | Which registers to save (and restore)

· | How to pass arguments (to and from Inline Assembler routines)

· | The need to pop everything you push

· | The differences between near and far calls

· | The rules to follow when writing assembly-language routines

See Also

The Inline Assembler

Inline Assembler code syntax