APPENDIX B CREATING PROCEDURE OF ASSEMBLY SOURCE FILE (Sub tool chain)
S5U1C88000C MANUAL II
EPSON
235
WORKBENCH/DEV TOOLS/OLD ASSEMBLER
APPENDIX
B C
REATING
P
ROCEDURE
OF
A
SSEMBLY
S
OURCE
F
ILE
(Sub tool chain)
B.1 Outline
When you develop a program using the assembly language, first create an assembly source file using the
CPU instructions and the pseudo-instructions included with the cross assembler. The assembly source file
should be created according to the contents and rules to be explained hereafter, using an editor you have.
B.1.1 File Name
As explained in Section A.2.3, this assembler is separated into two programs: the structured preprocessor
sap88 which expands macro instructions into the format that can be assembled by the asm88, and the
cross assembler asm88 which actually executes assembly. Files to be handled in this series of procedures
are an assembly source file. However, since there are some difference in each file, extensions of the file
names are specified as below.
Structured assembly source file: file_name.s
This is an assembly source file which includes macro instructions, etc., and is input into the structured
preprocessor sap88. When you create programs using the assembler language, create assembly source
files to make the file name with the extension ".s".
Assembly source file: file_name.ms
This is an assembly source file in which the macro instructions have been expanded, and is generated
from the structured preprocessor sap88.
In the structured preprocessor sap88 and the cross assembler asm88, files with other extensions can be
input, but generally use the above mentioned extension.
B.1.2 Source File Differences Depending on sap88 and asm88
As explained in the previous section, format of the file to be input to the cross assembler asm88 is differ-
ent from that of the structured preprocessor sap88 as to contents.
The statement (line) such as macro instruction and sap88 pseudo-instruction, which can be used in the
structured preprocessor sap88, cannot be distinguished in the cross assembler asm88, and will cause an
error. Consequently, when using the macro instructions, be sure to expand it to the format which can be
input into the cross assembler asm88, using the structured preprocessor sap88.
In particularly, attention should be paid when modifying the source file ".ms" being input into the asm88
directly.
The pseudo-instructions which are incorporated in the cross assembler asm88 functions will not cause an
error in the structured preprocessor sap88.
In the pseudo-instructions explained later, details for only the structured preprocessor sap88 are indi-
cated by [sap88 only] or the notes are described. Take care when reading.
B.1.3 Macro Instructions
Macro instruction allows the user to define virtual instructions with instruction sequences. The structured
preprocessor sap88 expands the defined instructions into the source format that can be assembled by the
cross assembler asm88. The following describes the outline of it.
When using the same statement block in multiple parts of a program, previous define the statement block
with an optional name, after this the statement block can be called using the defined name. The defined
statement block is Macro. Describe the macro name that has been defined and necessary parameters in
program, to call the macro. That part is expanded in the contents of the statement block that have been
defined as a macro by the structured preprocessor sap88, and at that point the changing of the specified
parameters is also to be done.
In addition to the macro-definition and the macro-call, some pseudo-instructions related to the macro
have been provided. For details, see Section B.3.8.