Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor changes to 0xSCA

  • Loading branch information...
commit f009f7512440060d55c94114b814fce92b706a28 1 parent e6c6755
@joskuijpers joskuijpers authored
Showing with 64 additions and 62 deletions.
  1. +59 −59 ASM/Spec_0xSCA.txt
  2. +5 −3 ASM/Spec_0xSCA.xml
View
118 ASM/Spec_0xSCA.txt
@@ -76,15 +76,15 @@ Table of Contents
4.3.4. Origin relocation . . . . . . . . . . . . . . . . . . 5
4.3.5. Macros: macro block and macro insertion . . . . . . . 6
4.3.6. Repeat block . . . . . . . . . . . . . . . . . . . . . 6
- 4.3.7. Conditionals . . . . . . . . . . . . . . . . . . . . . 6
+ 4.3.7. Conditionals . . . . . . . . . . . . . . . . . . . . . 7
4.3.8. Error reporting . . . . . . . . . . . . . . . . . . . 7
4.3.9. Alignment . . . . . . . . . . . . . . . . . . . . . . 7
- 4.3.10. Echo general output . . . . . . . . . . . . . . . . . 7
+ 4.3.10. Echo general output . . . . . . . . . . . . . . . . . 8
5. Tokenizer Markup . . . . . . . . . . . . . . . . . . . . . . . 8
5.1. Labels . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.2. Inline character literals . . . . . . . . . . . . . . . . 8
6. Inline arithmetic . . . . . . . . . . . . . . . . . . . . . . 8
- 7. Conformance . . . . . . . . . . . . . . . . . . . . . . . . . 8
+ 7. Conformance . . . . . . . . . . . . . . . . . . . . . . . . . 9
7.1. Recognition of conformance . . . . . . . . . . . . . . . . 9
8. Design Rationale . . . . . . . . . . . . . . . . . . . . . . . 9
8.1. Labels . . . . . . . . . . . . . . . . . . . . . . . . . . 9
@@ -190,8 +190,8 @@ Kuijpers & Beermann [Page 3]
4.3. Directives
All directives in this section MUST be handled in order and in
- recognition of their position. For the purpose of this document,
- a dot (.) is used to describe preprocessor directives.
+ recognition of their position. For the purpose of this document, a
+ dot (.) is used to describe preprocessor directives.
4.3.1. Inclusion
@@ -202,7 +202,8 @@ Kuijpers & Beermann [Page 3]
The former directive MUST include the file into the current file.
The path is relative to the current file. The assembler SHOULD
- report to the user if the given filename does not exist.
+ report to the user if the given filename does not exist and continue
+ assembly.
The latter includes the file from an implementation defined location,
which may not even exist but trigger certain behaviour, i.e.
@@ -219,7 +220,6 @@ Kuijpers & Beermann [Page 3]
-
Kuijpers & Beermann [Page 4]
Assembly Syntactics April 2012
@@ -232,10 +232,11 @@ Kuijpers & Beermann [Page 4]
.def name [value]
.define name [value]
+ .equ name value
.undef name
- def/define MUST assign the constant value to name. If the value is
- omitted, the literal 1 (one) MUST be assumed.
+ def/define/equ MUST assign the constant value to name. If the value
+ is omitted, the literal 1 (one) MUST be assumed.
undef MUST remove the given symbol from the namespace. If the given
symbol does not exist compilation SHOULD continue and a warning MAY
@@ -254,7 +255,8 @@ Kuijpers & Beermann [Page 4]
location of the directive.
db (data byte) MUST pack (i.e. two bytes per word, first byte is LSB)
- the values at the location of the directive.
+ the values at the location of the directive. Words are filled with
+ empty bytes when the data does not evenly fit into 16-bit words.
ascii MUST store the string unpacked (i.e. character is LSB, one word
per character) at the location of the directive.
@@ -271,8 +273,6 @@ Kuijpers & Beermann [Page 4]
.org address
- The org preprocessor directive MUST take an address as the only
- argument. Assemblers SHOULD verify the address is 16-bit sized.
@@ -281,6 +281,8 @@ Kuijpers & Beermann [Page 5]
Assembly Syntactics April 2012
+ The org preprocessor directive MUST take an address as the only
+ argument. Assemblers SHOULD verify the address is 16-bit sized.
Assembler MUST add this address to the address of all labels,
creating a relocation of the program.
@@ -314,6 +316,27 @@ Kuijpers & Beermann [Page 5]
directives inside the repeat-block MUST be handled when the
repetition is complete, to make allow conditional repetitions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Kuijpers & Beermann [Page 6]
+
+ Assembly Syntactics April 2012
+
+
4.3.7. Conditionals
.if expression
@@ -329,14 +352,6 @@ Kuijpers & Beermann [Page 5]
.ifndef definition
isdef(definition)
-
-
-
-Kuijpers & Beermann [Page 6]
-
- Assembly Syntactics April 2012
-
-
For the definition of valid expressions, see Section 6.
The if clause is REQUIRED. The else clause is OPTIONAL. The elif/
@@ -370,6 +385,14 @@ Kuijpers & Beermann [Page 6]
Aligns code or data on doubleword or other boundary.
+
+
+
+Kuijpers & Beermann [Page 7]
+
+ Assembly Syntactics April 2012
+
+
The assembler MUST add zeroed words (0x0000) to the generated
machinecode until the alignment is correct. The number of words
inserted can be calculated using the formula: 'boundary -
@@ -385,14 +408,6 @@ Kuijpers & Beermann [Page 6]
The assembler SHOULD report the message to the user.
-
-
-
-Kuijpers & Beermann [Page 7]
-
- Assembly Syntactics April 2012
-
-
5. Tokenizer Markup
5.1. Labels
@@ -426,6 +441,14 @@ Kuijpers & Beermann [Page 7]
AND) ^ (bit-wise XOR), | (bit-wise OR), ~ (bit-wise NOT), << and >>
(bit-wise shifts).
+
+
+
+Kuijpers & Beermann [Page 8]
+
+ Assembly Syntactics April 2012
+
+
The following logical and bitwise operators MUST also be supported:
== (equal), != (not equal, also <>), < (smaller than), > (greater
than), <= (smaller or equal), >= (greater or equal), & (bit-wise AND)
@@ -438,17 +461,6 @@ Kuijpers & Beermann [Page 7]
7. Conformance
-
-
-
-
-
-
-Kuijpers & Beermann [Page 8]
-
- Assembly Syntactics April 2012
-
-
7.1. Recognition of conformance
An assembler, formatter and any other assembly related program that
@@ -485,6 +497,14 @@ Kuijpers & Beermann [Page 8]
Both kinds of file inclusion support two different forms, one
including the file relative to the current file, and the other
+
+
+
+Kuijpers & Beermann [Page 9]
+
+ Assembly Syntactics April 2012
+
+
including it from an implementation defined location. The former is
ideal for splitting a program in multiple parts, while the latter is
intended for implementation-provided resources such as source level
@@ -497,14 +517,6 @@ Kuijpers & Beermann [Page 8]
low.
-
-
-
-Kuijpers & Beermann [Page 9]
-
- Assembly Syntactics April 2012
-
-
9. Security Considerations
This memo has no applicable security considerations.
@@ -544,17 +556,5 @@ Authors' Addresses
-
-
-
-
-
-
-
-
-
-
-
-
Kuijpers & Beermann [Page 10]
View
8 ASM/Spec_0xSCA.xml
@@ -110,7 +110,7 @@
<t>The former directive MUST include the file into the
current file. The path is relative to the current file.
The assembler SHOULD report to the user if the given
- filename does not exist.</t>
+ filename does not exist and continue assembly.</t>
<t>The latter includes the file from an implementation
defined location, which may not even exist but trigger
certain behaviour, i.e. inclusion of intrinsics.</t>
@@ -131,8 +131,9 @@
<figure><artwork><![CDATA[
.def name [value]
.define name [value]
+.equ name value
.undef name]]></artwork></figure>
- <t>def/define MUST assign the constant value to name. If the value
+ <t>def/define/equ MUST assign the constant value to name. If the value
is omitted, the literal 1 (one) MUST be assumed.</t>
<t>undef MUST remove the given symbol from the namespace.
If the given symbol does not exist compilation SHOULD
@@ -148,7 +149,8 @@
<t>dw (data word) MUST store the values literally and unpacked at
the location of the directive.</t>
<t>db (data byte) MUST pack (i.e. two bytes per word, first byte is LSB)
- the values at the location of the directive.</t>
+ the values at the location of the directive. Words are filled with empty
+ bytes when the data does not evenly fit into 16-bit words.</t>
<t>ascii MUST store the string unpacked (i.e. character is LSB,
one word per character) at the location of the directive.</t>
<t>asciip (a pascal string) MUST store the string unpacked (i.e.
Please sign in to comment.
Something went wrong with that request. Please try again.