Skip to content
This repository
Browse code

Minor changes to 0xSCA

  • Loading branch information...
commit f009f7512440060d55c94114b814fce92b706a28 1 parent e6c6755
Jos Kuijpers authored
118  ASM/Spec_0xSCA.txt
@@ -76,15 +76,15 @@ Table of Contents
76 76
        4.3.4.  Origin relocation  . . . . . . . . . . . . . . . . . .  5
77 77
        4.3.5.  Macros: macro block and macro insertion  . . . . . . .  6
78 78
        4.3.6.  Repeat block . . . . . . . . . . . . . . . . . . . . .  6
79  
-       4.3.7.  Conditionals . . . . . . . . . . . . . . . . . . . . .  6
  79
+       4.3.7.  Conditionals . . . . . . . . . . . . . . . . . . . . .  7
80 80
        4.3.8.  Error reporting  . . . . . . . . . . . . . . . . . . .  7
81 81
        4.3.9.  Alignment  . . . . . . . . . . . . . . . . . . . . . .  7
82  
-       4.3.10. Echo general output  . . . . . . . . . . . . . . . . .  7
  82
+       4.3.10. Echo general output  . . . . . . . . . . . . . . . . .  8
83 83
    5.  Tokenizer Markup . . . . . . . . . . . . . . . . . . . . . . .  8
84 84
      5.1.  Labels . . . . . . . . . . . . . . . . . . . . . . . . . .  8
85 85
      5.2.  Inline character literals  . . . . . . . . . . . . . . . .  8
86 86
    6.  Inline arithmetic  . . . . . . . . . . . . . . . . . . . . . .  8
87  
-   7.  Conformance  . . . . . . . . . . . . . . . . . . . . . . . . .  8
  87
+   7.  Conformance  . . . . . . . . . . . . . . . . . . . . . . . . .  9
88 88
      7.1.  Recognition of conformance . . . . . . . . . . . . . . . .  9
89 89
    8.  Design Rationale . . . . . . . . . . . . . . . . . . . . . . .  9
90 90
      8.1.  Labels . . . . . . . . . . . . . . . . . . . . . . . . . .  9
@@ -190,8 +190,8 @@ Kuijpers & Beermann                                             [Page 3]
190 190
 4.3.  Directives
191 191
 
192 192
    All directives in this section MUST be handled in order and in
193  
-   recognition of their position.  For the purpose of this document,
194  
-   a dot (.) is used to describe preprocessor directives.
  193
+   recognition of their position.  For the purpose of this document, a
  194
+   dot (.) is used to describe preprocessor directives.
195 195
 
196 196
 4.3.1.  Inclusion
197 197
 
@@ -202,7 +202,8 @@ Kuijpers & Beermann                                             [Page 3]
202 202
 
203 203
    The former directive MUST include the file into the current file.
204 204
    The path is relative to the current file.  The assembler SHOULD
205  
-   report to the user if the given filename does not exist.
  205
+   report to the user if the given filename does not exist and continue
  206
+   assembly.
206 207
 
207 208
    The latter includes the file from an implementation defined location,
208 209
    which may not even exist but trigger certain behaviour, i.e.
@@ -219,7 +220,6 @@ Kuijpers & Beermann                                             [Page 3]
219 220
 
220 221
 
221 222
 
222  
-
223 223
 Kuijpers & Beermann                                             [Page 4]
224 224
 
225 225
                            Assembly Syntactics                April 2012
@@ -232,10 +232,11 @@ Kuijpers & Beermann                                             [Page 4]
232 232
 
233 233
    .def name [value]
234 234
    .define name [value]
  235
+   .equ name value
235 236
    .undef name
236 237
 
237  
-   def/define MUST assign the constant value to name.  If the value is
238  
-   omitted, the literal 1 (one) MUST be assumed.
  238
+   def/define/equ MUST assign the constant value to name.  If the value
  239
+   is omitted, the literal 1 (one) MUST be assumed.
239 240
 
240 241
    undef MUST remove the given symbol from the namespace.  If the given
241 242
    symbol does not exist compilation SHOULD continue and a warning MAY
@@ -254,7 +255,8 @@ Kuijpers & Beermann                                             [Page 4]
254 255
    location of the directive.
255 256
 
256 257
    db (data byte) MUST pack (i.e. two bytes per word, first byte is LSB)
257  
-   the values at the location of the directive.
  258
+   the values at the location of the directive.  Words are filled with
  259
+   empty bytes when the data does not evenly fit into 16-bit words.
258 260
 
259 261
    ascii MUST store the string unpacked (i.e. character is LSB, one word
260 262
    per character) at the location of the directive.
@@ -271,8 +273,6 @@ Kuijpers & Beermann                                             [Page 4]
271 273
 
272 274
    .org address
273 275
 
274  
-   The org preprocessor directive MUST take an address as the only
275  
-   argument.  Assemblers SHOULD verify the address is 16-bit sized.
276 276
 
277 277
 
278 278
 
@@ -281,6 +281,8 @@ Kuijpers & Beermann                                             [Page 5]
281 281
                            Assembly Syntactics                April 2012
282 282
 
283 283
 
  284
+   The org preprocessor directive MUST take an address as the only
  285
+   argument.  Assemblers SHOULD verify the address is 16-bit sized.
284 286
    Assembler MUST add this address to the address of all labels,
285 287
    creating a relocation of the program.
286 288
 
@@ -314,6 +316,27 @@ Kuijpers & Beermann                                             [Page 5]
314 316
    directives inside the repeat-block MUST be handled when the
315 317
    repetition is complete, to make allow conditional repetitions.
316 318
 
  319
+
  320
+
  321
+
  322
+
  323
+
  324
+
  325
+
  326
+
  327
+
  328
+
  329
+
  330
+
  331
+
  332
+
  333
+
  334
+
  335
+Kuijpers & Beermann                                             [Page 6]
  336
+
  337
+                           Assembly Syntactics                April 2012
  338
+
  339
+
317 340
 4.3.7.  Conditionals
318 341
 
319 342
    .if expression
@@ -329,14 +352,6 @@ Kuijpers & Beermann                                             [Page 5]
329 352
    .ifndef definition
330 353
    isdef(definition)
331 354
 
332  
-
333  
-
334  
-
335  
-Kuijpers & Beermann                                             [Page 6]
336  
-
337  
-                           Assembly Syntactics                April 2012
338  
-
339  
-
340 355
    For the definition of valid expressions, see Section 6.
341 356
 
342 357
    The if clause is REQUIRED.  The else clause is OPTIONAL.  The elif/
@@ -370,6 +385,14 @@ Kuijpers & Beermann                                             [Page 6]
370 385
 
371 386
    Aligns code or data on doubleword or other boundary.
372 387
 
  388
+
  389
+
  390
+
  391
+Kuijpers & Beermann                                             [Page 7]
  392
+
  393
+                           Assembly Syntactics                April 2012
  394
+
  395
+
373 396
    The assembler MUST add zeroed words (0x0000) to the generated
374 397
    machinecode until the alignment is correct.  The number of words
375 398
    inserted can be calculated using the formula: 'boundary -
@@ -385,14 +408,6 @@ Kuijpers & Beermann                                             [Page 6]
385 408
    The assembler SHOULD report the message to the user.
386 409
 
387 410
 
388  
-
389  
-
390  
-
391  
-Kuijpers & Beermann                                             [Page 7]
392  
-
393  
-                           Assembly Syntactics                April 2012
394  
-
395  
-
396 411
 5.  Tokenizer Markup
397 412
 
398 413
 5.1.  Labels
@@ -426,6 +441,14 @@ Kuijpers & Beermann                                             [Page 7]
426 441
    AND) ^ (bit-wise XOR), | (bit-wise OR), ~ (bit-wise NOT), << and >>
427 442
    (bit-wise shifts).
428 443
 
  444
+
  445
+
  446
+
  447
+Kuijpers & Beermann                                             [Page 8]
  448
+
  449
+                           Assembly Syntactics                April 2012
  450
+
  451
+
429 452
    The following logical and bitwise operators MUST also be supported:
430 453
    == (equal), != (not equal, also <>), < (smaller than), > (greater
431 454
    than), <= (smaller or equal), >= (greater or equal), & (bit-wise AND)
@@ -438,17 +461,6 @@ Kuijpers & Beermann                                             [Page 7]
438 461
 
439 462
 7.  Conformance
440 463
 
441  
-
442  
-
443  
-
444  
-
445  
-
446  
-
447  
-Kuijpers & Beermann                                             [Page 8]
448  
-
449  
-                           Assembly Syntactics                April 2012
450  
-
451  
-
452 464
 7.1.  Recognition of conformance
453 465
 
454 466
    An assembler, formatter and any other assembly related program that
@@ -485,6 +497,14 @@ Kuijpers & Beermann                                             [Page 8]
485 497
 
486 498
    Both kinds of file inclusion support two different forms, one
487 499
    including the file relative to the current file, and the other
  500
+
  501
+
  502
+
  503
+Kuijpers & Beermann                                             [Page 9]
  504
+
  505
+                           Assembly Syntactics                April 2012
  506
+
  507
+
488 508
    including it from an implementation defined location.  The former is
489 509
    ideal for splitting a program in multiple parts, while the latter is
490 510
    intended for implementation-provided resources such as source level
@@ -497,14 +517,6 @@ Kuijpers & Beermann                                             [Page 8]
497 517
    low.
498 518
 
499 519
 
500  
-
501  
-
502  
-
503  
-Kuijpers & Beermann                                             [Page 9]
504  
-
505  
-                           Assembly Syntactics                April 2012
506  
-
507  
-
508 520
 9.  Security Considerations
509 521
 
510 522
    This memo has no applicable security considerations.
@@ -544,17 +556,5 @@ Authors' Addresses
544 556
 
545 557
 
546 558
 
547  
-
548  
-
549  
-
550  
-
551  
-
552  
-
553  
-
554  
-
555  
-
556  
-
557  
-
558  
-
559 559
 Kuijpers & Beermann                                            [Page 10]
560 560
 
8  ASM/Spec_0xSCA.xml
@@ -110,7 +110,7 @@
110 110
                         <t>The former directive MUST include the file into the
111 111
                         current file. The path is relative to the current file.
112 112
                         The assembler SHOULD report to the user if the given
113  
-                        filename does not exist.</t>
  113
+                        filename does not exist and continue assembly.</t>
114 114
                         <t>The latter includes the file from an implementation
115 115
                         defined location, which may not even exist but trigger
116 116
                         certain behaviour, i.e. inclusion of intrinsics.</t>
@@ -131,8 +131,9 @@
131 131
                     <figure><artwork><![CDATA[
132 132
 .def name [value]
133 133
 .define name [value]
  134
+.equ name value
134 135
 .undef name]]></artwork></figure>
135  
-                    <t>def/define MUST assign the constant value to name. If the value
  136
+                    <t>def/define/equ MUST assign the constant value to name. If the value
136 137
                     is omitted, the literal 1 (one) MUST be assumed.</t>
137 138
                     <t>undef MUST remove the given symbol from the namespace.
138 139
                     If the given symbol does not exist compilation SHOULD
@@ -148,7 +149,8 @@
148 149
                     <t>dw (data word) MUST store the values literally and unpacked at
149 150
                     the location of the directive.</t>
150 151
                     <t>db (data byte) MUST pack (i.e. two bytes per word, first byte is LSB)
151  
-                    the values at the location of the directive.</t>
  152
+                    the values at the location of the directive. Words are filled with empty
  153
+                    bytes when the data does not evenly fit into 16-bit words.</t>
152 154
                     <t>ascii MUST store the string unpacked (i.e. character is LSB,
153 155
                     one word per character) at the location of the directive.</t>
154 156
                     <t>asciip (a pascal string) MUST store the string unpacked (i.e.

0 notes on commit f009f75

Please sign in to comment.
Something went wrong with that request. Please try again.