SICASM.DOC

advertisement
INSTALLING THE SIC ASSEMBLER
The SIC assembler is written in standard Pascal. It should be
possible
to install this assembler on almost any computer with a Pascal
compiler,
by making the minor changes described below.
INPUT AND OUTPUT
All of the ASSIGN statements are located in the main procedure
(lines 1499-1502). These statements may need to be changed
(or removed) if your system uses some other means for
associating internal and external file names. Similarly, the
CLOSE statements (lines 1439, 1485-1487) may need to be changed
or removed.
CHARACTER CODES
The SIC machine uses ASCII character codes. Therefore, the
assembler must convert from the character codes used by the host
machine to the ASCII equivalent in order to assemble character
string constants. The information needed to do this translation
is supplied in the array named ascii; initialization statements
for this array begin at line 1591.
If the host machine uses ASCII character codes, the only
initialization needed is the statement
for i := 0 TO 255 do ascii[i] := i;
If the host machine uses a different set of character codes,
initialization is performed with a series of statements of
the form
ascii[h] := a;
where 'h' is the ordinal value for some character on the host
computer, and 'a' is the ordinal value for the same character
in the ASCII character set.
-------------------------------------------------------------------HOW TO USE THE SIC ASSEMBLER
This is a simple assembler for SIC (standard version). It uses the
following external files:
SRCFILE -- the source program to be assembled
OBJFILE -- the object program generated by the assembly
LISFILE -- the assembly listing
INTFILE -- intermediate working file for the assembler.
The assembler supports all standard SIC features and instructions,
and the assembler directives START, END, BYTE, WORD, RESB, RESW.
General information about the SIC instructions and assembler
directives
can be found in "System Software" (Chapter 2 and Appendix A).
Implementation conventions and restrictions for this assembler are
described below.
SOURCE FORMAT
The source program to be assembled must be in fixed format as follows:
Bytes
1-8
9
10-15
16-17
18-35
36-66
Label
Blank
Operation code (or Assembler directive)
Blank
Operand
Comment
Imbedded blanks are not allowed in the Label, Operation code, or
Operand fields (except within a character string in a BYTE directive).
If a source line contains a period (.) in the first byte, the entire
line is treated as a comment.
CHARACTER SET
Source program statements may be written using either uppercase or
lowercase letters.
INSTRUCTION OPERANDS
Instruction operands may be either a symbol (which appears as a label
in the program), or an actual hexadecimal address (4 hex digits or
less).
Hexadecimal addresses that would begin with 'A' through 'F' must start
with a leading '0' (to distinguish them from labels). Either type of
operand may be followed by ',X' to indicate indexed addressing.
START STATEMENT
The first statement in the source program (except for comment lines)
must be START. No other START statements may appear in the program.
The operand for START is a hexadecimal address (4 hex digits or less),
which is taken as the starting address for the program.
END STATEMENT
The last statement in the source program should be END. The operand
for END must be a symbol which appears as a label in the program.
BYTE STATEMENT
The operand for a BYTE statement must be of the form C'ccc...' or
X'hhh...', as described in "System Software." The maximum length
of the operand is 15 characters or 14 hex digits (representing 7
bytes).
WORD STATEMENT
The operand for a WORD statement may be either a symbol (which appears
as a label in the program) or a decimal integer (4 digits or less).
Integers may be preceded by a minus sign (-) to indicate negative
values.
RESB AND RESW STATEMENTS
The operand for RESB or RESW should be a non-negative decimal integer
(4 digits or less).
ADDRESS LIMITATION
The maximum address handled or displayed by the assembler is FFFF.
Download