annotate doc/pseudoops.txt @ 125:f9bfc2986023

Actually allow script file to be specified and fix segfault on parsing script file
author lost
date Fri, 23 Jan 2009 04:53:01 +0000
parents f643e2ff0008
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
1 The following pseudo operations are understood by LWASM.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
2
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
3 SECTION <name>
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
4
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
5 This introduces a section called <name>. This is only valid if assembling to
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
6 an object file. Only one section can be open at any given time. Sections
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
7 may be ended with ENDSECTION. Only one section can be open at any given
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
8 time. A subsequent SECTION directive will end the previous section. It is
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
9 important to note that an end of file does not close the currently open
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
10 section. There cannot be a symbol on a SECTION line.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
11
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
12 ENDSECTION
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
13
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
14 Specifies the end of a section. This is optional. There cannot be a symbol
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
15 on an ENDSECTION line.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
16
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
17 ORG <addr>
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
18
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
19 Specifies the assembly address. For the raw target, this is advisory and
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
20 only affects the addresses of symbols. For the object file target, this can
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
21 only appear outside of all sections. For the DECB target, each ORG statement
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
22 after which any output is generated will generate a segment in the output
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
23 file. <addr> must be completely resolved during pass 1 of the assembly
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
24 process and thus may not refer to forward references or external symbols, or
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
25 other symbols that refer to such.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
26
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
27 <symbol> EQU <value>
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
28
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
29 Makes <symbol> equivalent to <value>. <value> may be an external reference
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
30 in which case any references to <symbol> will also be external references.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
31
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
32 EXPORT <symbol>[ as <name>]
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
33
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
34 Marks previously defined <symbol> for export. If <name> is specified, it
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
35 will be exported as <name>. <symbol> must not be an external reference and
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
36 must be defined before EXPORT.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
37
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
38 EXTERN <symbol>[ as <name>]
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
39 IMPORT <symbol>[ as <name>]
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
40
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
41 Marks <symbol> as an external reference. If <name> is specified, <name> is
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
42 the local name the symbol is references as in this assembly file while
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
43 <symbol> is the actual symbol to be referenced externally.
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
44
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
45 END [<addr>]
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
46
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
47 Marks the end of the assembly process. Immediately terminates assembly
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
48 without processing any other lines in this file or any others. It is
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
49 optional. <addr> is only allowed for the DECB target in which case it
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
50 specifies the execution address. If it is not specified, the address
7fbccdd1defb Added doc subdirectory to distribution
lost
parents:
diff changeset
51 defaults to 0.