A.S.P. [A]ssembly [S]ource [P]reprocessor For CUBIX 6809 Assembler Revised: 30-Jul-90 Dunfield Development Systems ---------------------------- High quality tools for Embedded Development at low prices. https://dunfield.themindfactory.com Copyright 1983-2005 Dave Dunfield All rights Reserved A.S.P. Users Guide TABLE OF CONTENTS Page 1. INTRODUCTION 1 1.1 ASP Control Statements 2 1.2 Assignments 4 1.3 Expressions 4 1.4 Labels 4 1.5 Comments 4 2. QUALIFIERS 5 2.1 /COMMENT 5 2.2 /QUIET 5 2.3 /SOURCE 5 3. SAMPLE PROGRAM 6 A.S.P. Users Guide Page: 1 1. INTRODUCTION ASP is an assembly language source preprocessor, which allows the programmer to uses expressions, and control structures from within an assembler program. ASP reads as it's input an ASP/Assembler source file, (Type='.ASP'), and produces as its output a standard assembler file (Type='.ASM') which can be assembled using the system assembler. ASP will produce extra code in the output assembler file, which will perform the expressions and control structures which were detected in the input file. The code generated by ASP uses ONLY the A and B accumulator registers in the 6809, and will never affect the index registers, allowing them to be accessed completely by the program code. The A and B accumultors may be modified by ASP when performing certain functions, but will never be expected to contain values after an assembler portion of the program is executed. For the execution of the 'IF / ELSE / END' and 'WHILE / END' constructs, ASP will place labels in the output file. The internal labels generated by ASP are always preceded by the '_' character, to avoid conflicts with assembler code labels. Variable names, and statement labels are placed in the output file exactly as they are spelled in the program, allowing the assembler code to access them. ASP is intended to simplify the control structures within assembler source programs, and as such, does not make great attempts to produce efficent code. While entire programs can be written using ASP statements, such an approach is bound to produce less efficent code then when writing in proper assembler. A.S.P. Users Guide Page: 2 1.1 ASP Control Statements 1.1.1 ASM The ASM statement causes ASP to assume all following lines up to an 'END' statement are assembler source statements, and will copy them into the output file qithout change. 1.1.2 BYTE [, ...] or BYTE CONSTANT = [,= ...] BYTE defines 1 or more 8 bit storage location, which can be refered to by the symbolic names specified. Each symbol will be assigned one byte of storage, unless it is followed by a number in braces EG: 'BYTE ABC(10 )' which causes the specified number of bytes to be reserved. (The space before the closing brace is nessary due to DOS call used to evaluate number). If the CONSTANT keyword is found, the sumbols must have a value assigned to them, and will be EQUated to that value, and not assigned a location in memory. 1.1.3 CALL