Blitz Basic 2 - Reference Guide-ENG

Page 93

9. Assembler This section will cover commands related to Blitz 2's in-line assembler. It is assumed that readers of this section are already knowledgable in 68000 assembly language, as no attempt will be made to teach this subject. Blitz 2's assembler is very easy to use. All 68000 mnemonics are tokenised as if they were BASIC keywords, and are assembled into machine code when a program is compiled. 68000 code may be intermixed freely with basic, though of course care must be taken not to upset the system. If you are wanting to use the Blitz 2 assembler for writing straight machine code programs, then you are free to treat Blitz 2 as if it was simply an assembler instead of a compiler. In fact, if you enable runtime error checking, Blitz 2 will even attempt to trap any GURU's in your code!However, if you are wanting to intermix assembly language with BASIC, there are some important rules you must follow: * Address registers A4-A6 must be preserved and restored by any assembly language routines. Blitz 2

uses A5 as a global variable base, A4 as a local variable base, and tries to keep A6 from having to be re-Ioaded too often. The Blitz 2 assembler does have some limitations: * The Absolute Short addressing mode is not supported.

* Short Branches are not supported. * Any assembler expressions MUST use curly brackets ('{' and '}') to force operator precedence.

Apart from this, the Blitz 2 assembler operates identically to most commercially available assemblers.

Statement: DC Syntax:

De [.Size] Data[,Data ...]

Description:

De stands for 'define constant', and may be used to define areas of data for assembler programs.

Statement: DCB Syntax: DCB [.Size] Repeats,Data Description:

DeB stand for 'define constant block'. DeB allows you to insert a repeating series of the same value into your assembler programs.

9-1


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.