-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
714 lines (647 loc) · 43.6 KB
/
index.html
File metadata and controls
714 lines (647 loc) · 43.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<meta name="generator" content="LibreOffice 7.3.7.2 (Linux)"/>
<meta name="created" content="2023-01-23T23:54:33.935675256"/>
<meta name="changed" content="2023-02-21T19:50:27.320321778"/>
<style type="text/css">
@page { size: 21cm 29.7cm; margin: 2cm }
p { line-height: 115%; margin-bottom: 0.25cm; background: transparent }
p.sdfootnote { font-size: 10pt; line-height: 100%; margin-left: 0.6cm; text-indent: -0.6cm; margin-bottom: 0cm; background: transparent }
h1 { margin-bottom: 0.21cm; background: transparent; page-break-after: avoid }
h1.western { font-family: "Liberation Sans", sans-serif; font-size: 18pt; font-weight: bold }
h1.cjk { font-family: "Noto Sans CJK SC"; font-size: 18pt; font-weight: bold }
h1.ctl { font-family: "Lohit Devanagari"; font-size: 18pt; font-weight: bold }
h2 { margin-top: 0.35cm; margin-bottom: 0.21cm; background: transparent; page-break-after: avoid }
h2.western { font-family: "Liberation Sans", sans-serif; font-size: 16pt; font-weight: bold }
h2.cjk { font-family: "Noto Sans CJK SC"; font-size: 16pt; font-weight: bold }
h2.ctl { font-family: "Lohit Devanagari"; font-size: 16pt; font-weight: bold }
a:link { color: #000080; so-language: zxx; text-decoration: underline }
a:visited { color: #800000; so-language: zxx; text-decoration: underline }
a.sdfootnoteanc { font-size: 57% }
</style>
</head>
<body lang="en-IN" link="#000080" vlink="#800000" dir="ltr"><p align="center" style="line-height: 100%; margin-bottom: 0cm">
<font size="5" style="font-size: 18pt"><b>The Extremely Small File
Format </b></font><font size="5" style="font-size: 18pt"><b>23</b></font><font size="5" style="font-size: 18pt"><b>
Specification (Draft)</b></font></p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm">Revision
3</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm">February
2023</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm">Copyright
(c) Somdipto Chakraborty</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm">This
work is licensed under the Creative Commons Attribution-NoDerivatives
4.0 International License</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="left" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="left" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="left" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="left" style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p align="center" style="line-height: 100%; margin-bottom: 0cm"><font size="5" style="font-size: 18pt">Abstract</font></p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">This standard
specifies the structure of <i>extremely small executable</i><span style="font-style: normal">
and </span><i>extremely small loadable</i><span style="font-style: normal">
file</span><span style="font-style: normal">s</span><span style="font-style: normal">.
The purpose of this document is to </span><span style="font-style: normal">standardize
</span><span style="font-style: normal">the </span><i>extremely small</i><span style="font-style: normal">
file format </span><span style="font-style: normal">to </span><span style="font-style: normal">promote
</span><span style="font-style: normal">correctness </span><span style="font-style: normal">of
such files.</span></p>
<p style="font-style: normal; line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal">Any
additional details of the environment </span><span style="font-style: normal">are
not covered by this standard.</span></p>
<p style="line-height: 100%; margin-bottom: 0cm; page-break-before: always">
<br/>
</p>
<div id="Table of Contents1" dir="ltr">
<div id="Table of Contents1_Head" dir="ltr"><p style="line-height: 100%; margin-top: 0.42cm; margin-bottom: 0.21cm; page-break-before: always; page-break-after: avoid">
<font face="Liberation Sans, sans-serif"><font size="4" style="font-size: 16pt"><b>Table
of Contents</b></font></font></p>
</div>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1018_225939230">Introduction 4</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1020_225939230">1.
Terms and definitions 5</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1294_278047018">2.
Environments 6</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><a href="#__RefHeading___Toc1024_225939230">3</a><a href="#__RefHeading___Toc1024_225939230">.
Limits</a></span><a href="#__RefHeading___Toc1024_225939230"> 6</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1026_225939230">4.
Parsing 6</a></p>
<p lang="zxx" style="line-height: 100%; margin-left: 0.5cm; margin-bottom: 0cm">
<span style="font-style: normal"><a href="#__RefHeading___Toc1028_225939230">4</a><a href="#__RefHeading___Toc1028_225939230">.</a><a href="#__RefHeading___Toc1028_225939230">1</a><a href="#__RefHeading___Toc1028_225939230">
Pa</a><a href="#__RefHeading___Toc1028_225939230">rs</a><a href="#__RefHeading___Toc1028_225939230">ing
a</a><a href="#__RefHeading___Toc1028_225939230">n</a><a href="#__RefHeading___Toc1028_225939230">
extremely small executable file</a></span><a href="#__RefHeading___Toc1028_225939230"> 6</a></p>
<p lang="zxx" style="line-height: 100%; margin-left: 0.5cm; margin-bottom: 0cm">
<span style="font-style: normal"><a href="#__RefHeading___Toc1030_225939230">4</a><a href="#__RefHeading___Toc1030_225939230">.</a><a href="#__RefHeading___Toc1030_225939230">2</a><a href="#__RefHeading___Toc1030_225939230">
Parsing a</a><a href="#__RefHeading___Toc1030_225939230">n</a><a href="#__RefHeading___Toc1030_225939230">
extremely small loadable file</a></span><a href="#__RefHeading___Toc1030_225939230"> 7</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1034_225939230">Annex
A. Extremely small file structure summary (informative) 8</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc973_1655514702">Annex
B. Recommended practice (informative) 8</a></p>
<p lang="zxx" style="line-height: 100%; margin-bottom: 0cm"><a href="#__RefHeading___Toc1036_225939230">Contributions 9</a></p>
</div>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western" style="page-break-before: always"><a name="__RefHeading___Toc1018_225939230"></a>
Introduction</h1>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
1 This is a draft version of the Extremely Small File Format
specification, and there may be significant changes made to this
standard before the final release. This draft version is only meant
for those who are interested in contributing to the development of
the Extremely Small File Format specification.</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
2 Footnotes are provided to clarify certain rules to the reader.</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">3</span><span style="font-weight: normal">
</span><span style="font-weight: normal">Footnotes and the annexes
are informative.</span></p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">4
</span><span style="font-weight: normal">Major changes from the
previous revision include:</span></p>
<ul>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">fix
</span><b>Annex A</b><span style="font-weight: normal"> to specify
the updated file structure from Revision 2</span></p>
</ul>
<h1 class="western" style="page-break-before: always"><a name="__RefHeading___Toc1020_225939230"></a>
1. Terms and definitions</h1>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.1
byte</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">smallest addressable
unit of storage</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.2
object</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">region of storage</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.2
alignment</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">requirement that an
object is loaded at an address that is a multiple of a specified
number of bytes</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.4
address</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">an integer that
specifies the location of an object in the interpreter</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.5
interpretation</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">process of parsing
data</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.6
data</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">sequence of bytes
that denote on<span style="font-style: normal">e of: the magic
number, </span><span style="font-style: normal">the specification
version, </span><span style="font-style: normal">the alignment of </span><span style="font-style: normal">the
</span><span style="font-style: normal">code, the alignment of the
heap, the size of the heap, the size of the stack, and the
entry-point.</span></p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.7
behavior</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm">external appearance
or action</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.8
stack</b></font></p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
interpreter-defined entity or object</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.9
heap</b></font></p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
interpreter-defined entity or object</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.10
code</b></font></p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
interpreter-defined entity or object</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.11
execution</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">process
of parsing </span><span style="font-weight: normal">one or more
sequence of bytes in </span><span style="font-weight: normal">a</span><span style="font-weight: normal">
</span><span style="font-weight: normal">loaded </span><span style="font-weight: normal">code</span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">in
a way </span></span><span style="font-style: normal"><span style="font-weight: normal">that
may or may not be documented by the interpreter</span></span><span style="font-style: normal"><span style="font-weight: normal"><a class="sdfootnoteanc" name="sdfootnote1anc" href="#sdfootnote1sym"><sup>1</sup></a></span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.12
interpreter-defined</b></font></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
process that is not defined by this standard, rather is left for the
interpreter to document</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.13
value</b></font></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
the result after a successful parse of data</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b>1.14
load</b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">place
in memor</span></span><span style="font-style: normal"><span style="font-weight: normal">y</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><font size="4" style="font-size: 15pt"><b><span style="font-style: normal">1.</span><span style="font-style: normal">15
parse</span></b></font></p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">make
sense of by </span></span><span style="font-style: normal"><span style="font-weight: normal">read</span></span><span style="font-style: normal"><span style="font-weight: normal">ing</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">an
</span></span><span style="font-style: normal"><span style="font-weight: normal">objec</span></span><span style="font-style: normal"><span style="font-weight: normal">t</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western"><a name="__RefHeading___Toc1294_278047018"></a>2.
Environments</h1>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">1
</span><span style="font-weight: normal">For the purpose of
describing how </span><span style="font-weight: normal">data</span><span style="font-weight: normal">
</span><span style="font-weight: normal">shall be</span><span style="font-weight: normal">
parsed, th</span><span style="font-weight: normal">is</span><span style="font-weight: normal">
standard describes </span><span style="font-weight: normal">two
environments:</span></p>
<ul>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">the</span><span style="font-weight: normal">
environment that writes the </span><i><span style="font-weight: normal">extremely
small executable</span></i><span style="font-weight: normal"> or
</span><i><span style="font-weight: normal">extremely small loadable</span></i><span style="font-weight: normal">
file (the </span><i><span style="font-weight: normal">writer
</span></i><i><span style="font-weight: normal">environment</span></i><span style="font-weight: normal">),
and</span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">the</span><span style="font-weight: normal">
environment that parses </span><span style="font-weight: normal">data
</span><span style="font-weight: normal">in that file (the
</span><i><span style="font-weight: normal">interpreter
</span></i><i><span style="font-weight: normal">environment</span></i><span style="font-weight: normal">).</span></p>
</ul>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">2
</span><span style="font-weight: normal">Data written by the writer
shall have the same value when interpreted by the interpreter</span><span style="font-weight: normal"><a class="sdfootnoteanc" name="sdfootnote2anc" href="#sdfootnote2sym"><sup>2</sup></a></span><span style="font-weight: normal">.</span></p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-weight: normal">3
</span><span style="font-weight: normal">Given a valid </span><i><span style="font-weight: normal">extremely
small</span></i><span style="font-style: normal"><span style="font-weight: normal">
file, a standard-conforming interpreter is required to interpret it
exactly as specified by this standard.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">4
For an invalid </span></span><i><span style="font-weight: normal">extremely
small</span></i><span style="font-style: normal"><span style="font-weight: normal">
file, an interpreter is required to quit the parsing process and
produce at least one diagnostic message.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western"><a name="__RefHeading___Toc1024_225939230"></a><span style="font-style: normal">3</span><span style="font-style: normal">.
Limits</span></h1>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">1
This standard </span></span><span style="font-style: normal"><span style="font-weight: normal">imposes
no</span></span><span style="font-style: normal"><span style="font-weight: normal">
restrict</span></span><span style="font-style: normal"><span style="font-weight: normal">ions
on</span></span><span style="font-style: normal"><span style="font-weight: normal">
the number of bytes that can designate the code.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">2
The value of the alignment of the code shall lie within the range 0
</span></span><span style="font-style: normal"><span style="font-weight: normal">to
</span></span><span style="font-style: normal"><span style="font-weight: normal">4294967295
inclusive.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">3
The value of the alignment of the heap shall lie within the range 0</span></span><span style="font-style: normal"><span style="font-weight: normal">
to </span></span><span style="font-style: normal"><span style="font-weight: normal">4294967295
inclusive.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">4
The value of the size of the heap shall lie within the range 0 </span></span><span style="font-style: normal"><span style="font-weight: normal">to
</span></span><span style="font-style: normal"><span style="font-weight: normal">18446744073709551615
inclusive.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">5
The value of the size of the stack shall lie within the range 0 </span></span><span style="font-style: normal"><span style="font-weight: normal">to
</span></span><span style="font-style: normal"><span style="font-weight: normal">18446744073709551615
inclusive.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">6
The value of the entry-point shall lie within the range 0 </span></span><span style="font-style: normal"><span style="font-weight: normal">to
</span></span><span style="font-style: normal"><span style="font-weight: normal">18446744073709551615
inclusive.</span></span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western"><a name="__RefHeading___Toc1026_225939230"></a>4.
Parsing</h1>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
1 If parsing fails at any stage of the parsing process, the file
being parsed is said to be invalid.</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h2 class="western"><a name="__RefHeading___Toc1028_225939230"></a><font size="4" style="font-size: 15pt"><span style="font-style: normal">4</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">.</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">1</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">
Pa</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">rs</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">ing
a</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">n</span></font><font size="4" style="font-size: 15pt"><span style="font-style: normal">
extremely small executable file</span></font></h2>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">1</span></span><span style="font-style: normal"><span style="font-weight: normal">
An interpreter shall parse a</span></span><span style="font-style: normal"><span style="font-weight: normal">n</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><i><span style="font-weight: normal">extremely small
executable</span></i><span style="font-style: normal"><span style="font-weight: normal">
file in the following steps:</span></span></p>
<ul>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
first 4 bytes are parsed. The result shall have the value 933631.
This is called the </span></span><i><span style="font-weight: normal">magic
number</span></i><span style="font-style: normal"><span style="font-weight: normal">,
which differentiates an </span></span><i><span style="font-weight: normal">extremely
small executable</span></i><span style="font-style: normal"><span style="font-weight: normal">
file from other </span></span><span style="font-style: normal"><span style="font-weight: normal">types
of </span></span><span style="font-style: normal"><span style="font-weight: normal">files.
</span></span><span style="font-style: normal"><span style="font-weight: normal">For
any other value, the file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">T</span></span><span style="font-style: normal"><span style="font-weight: normal">he
following 4 bytes designate the </span></span><i><span style="font-weight: normal">specification
version</span></i><span style="font-style: normal"><span style="font-weight: normal">.
The value yielded from parsing this data shall be equal to 35.
Otherwise, the file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
next 4 bytes designate the </span></span><i><span style="font-weight: normal">alignment
of the code</span></i><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">(in
bytes)</span></span><span style="font-style: normal"><span style="font-weight: normal">.
It is the boundary the code will be aligned to when it is loaded by
the interpreter. If the interpreter does not support such an
alignment, the file being parsed is invalid </span></span><span style="font-style: normal"><span style="font-weight: normal">and
the parsing stops. </span></span><span style="font-style: normal"><span style="font-weight: normal">If
the interpreter does not support </span></span><span style="font-style: normal"><span style="font-weight: normal">the
action of </span></span><span style="font-style: normal"><span style="font-weight: normal">aligning
the code to a specific boundary, this data is ignored.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
</span></span><span style="font-style: normal"><span style="font-weight: normal">next</span></span><span style="font-style: normal"><span style="font-weight: normal">
4 bytes designate the </span></span><i><span style="font-weight: normal">alignment
of the heap</span></i><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">(in
bytes)</span></span><span style="font-style: normal"><span style="font-weight: normal">.
It is the boundary the heap will be aligned to when it is loaded by
the interpreter. If the interpreter does not support such an
alignment, the file being parsed is invalid </span></span><span style="font-style: normal"><span style="font-weight: normal">and
the parsing stops. </span></span><span style="font-style: normal"><span style="font-weight: normal">If
the interpreter does not have a heap or does not support the action
of aligning the heap to a specific boundary, this data is ignored.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
</span></span><span style="font-style: normal"><span style="font-weight: normal">following
</span></span><span style="font-style: normal"><span style="font-weight: normal">8</span></span><span style="font-style: normal"><span style="font-weight: normal">
bytes designate the </span></span><i><span style="font-weight: normal">size
of the heap</span></i><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">(in
bytes)</span></span><span style="font-style: normal"><span style="font-weight: normal">.
It is the maximum size the heap can have </span></span><span style="font-style: normal"><span style="font-weight: normal">during
execution</span></span><span style="font-style: normal"><span style="font-weight: normal">.
</span></span><span style="font-style: normal"><span style="font-weight: normal">If
the interpreter does not have a heap </span></span><span style="font-style: normal"><span style="font-weight: normal">or
does not allow the action of setting a maximum size of the heap</span></span><span style="font-style: normal"><span style="font-weight: normal">,
this data is ignored.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
following </span></span><span style="font-style: normal"><span style="font-weight: normal">8</span></span><span style="font-style: normal"><span style="font-weight: normal">
bytes designate the </span></span><i><span style="font-weight: normal">size
of the stack</span></i><span style="font-style: normal"><span style="font-weight: normal">.
It is the maximum size the stack can have </span></span><span style="font-style: normal"><span style="font-weight: normal">during
execution</span></span><span style="font-style: normal"><span style="font-weight: normal">.
</span></span><span style="font-style: normal"><span style="font-weight: normal">The
unit of the size of the stack is interpreter-defined.</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">If
the interpreter does not have a stack </span></span><span style="font-style: normal"><span style="font-weight: normal">or
does not allow the action of setting a maximum size of the stack</span></span><span style="font-style: normal"><span style="font-weight: normal">,
this data is ignored.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
next 8 byte</span></span><span style="font-style: normal"><span style="font-weight: normal">s</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">constitute</span></span><span style="font-style: normal"><span style="font-weight: normal">
the </span></span><i><span style="font-weight: normal">entry-point</span></i><span style="font-style: normal"><span style="font-weight: normal">.
</span></span><span style="font-style: normal"><span style="font-weight: normal">It
shall designate an address where the control is transferred to when
the execution starts. </span></span><span style="font-style: normal"><span style="font-weight: normal">This
address must designate an object in the loaded code; otherwise, the
file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
next </span></span><span style="font-style: normal"><span style="font-weight: normal">optional
</span></span><span style="font-style: normal"><span style="font-weight: normal">sequence
of </span></span><span style="font-style: normal"><span style="font-weight: normal">bytes
constitute</span></span><span style="font-style: normal"><span style="font-weight: normal">s</span></span><span style="font-style: normal"><span style="font-weight: normal">
the </span></span><i><span style="font-weight: normal">code</span></i><span style="font-style: normal"><span style="font-weight: normal">.</span></span></p>
</ul>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h2 class="western"><a name="__RefHeading___Toc1030_225939230"></a><span style="font-style: normal">4</span><span style="font-style: normal">.</span><span style="font-style: normal">2</span><span style="font-style: normal">
Parsing a</span><span style="font-style: normal">n</span><span style="font-style: normal">
extremely small loadable file</span></h2>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">1</span></span><span style="font-style: normal"><span style="font-weight: normal">
An interpreter shall parse a</span></span><span style="font-style: normal"><span style="font-weight: normal">n</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><i><span style="font-weight: normal">extremely small
</span></i><i><span style="font-weight: normal">loadable</span></i><span style="font-style: normal"><span style="font-weight: normal">
file in the following steps:</span></span></p>
<ul>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
first 4 bytes are parsed. The result shall have the value 930303.
This is called the </span></span><i><span style="font-weight: normal">magic
number</span></i><span style="font-style: normal"><span style="font-weight: normal">,
which differentiates an </span></span><i><span style="font-weight: normal">extremely
small </span></i><i><span style="font-weight: normal">loadable</span></i><span style="font-style: normal"><span style="font-weight: normal">
file from other </span></span><span style="font-style: normal"><span style="font-weight: normal">types
of </span></span><span style="font-style: normal"><span style="font-weight: normal">files.
</span></span><span style="font-style: normal"><span style="font-weight: normal">For
any other value, the file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">T</span></span><span style="font-style: normal"><span style="font-weight: normal">he
following 4 bytes designate the </span></span><i><span style="font-weight: normal">specification
version</span></i><span style="font-style: normal"><span style="font-weight: normal">.
The value yielded from parsing this data shall be equal to 35.
Otherwise, the file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
next 4 bytes designate the </span></span><i><span style="font-weight: normal">alignment
of the code</span></i><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">(in
bytes)</span></span><span style="font-style: normal"><span style="font-weight: normal">.
It is the boundary the code will be aligned to when it is loaded by
the interpreter. If the interpreter does not support such an
alignment, the file being parsed is invalid.</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">If
the interpreter does not support </span></span><span style="font-style: normal"><span style="font-weight: normal">the
action of </span></span><span style="font-style: normal"><span style="font-weight: normal">aligning
the code to a specific boundary, this data is ignored.</span></span></p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
The next 4 bytes are the padding bytes and shall be ignored by the
interpreter.</p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
8 </span></span><span style="font-style: normal"><span style="font-weight: normal">bytes
succeeding the padding </span></span><span style="font-style: normal"><span style="font-weight: normal">byte</span></span><span style="font-style: normal"><span style="font-weight: normal">s</span></span><span style="font-style: normal"><span style="font-weight: normal">
</span></span><span style="font-style: normal"><span style="font-weight: normal">constitute</span></span><span style="font-style: normal"><span style="font-weight: normal">
the </span></span><i><span style="font-weight: normal">entry-point</span></i><span style="font-style: normal"><span style="font-weight: normal">.
</span></span><span style="font-style: normal"><span style="font-weight: normal">It
shall designate an address where the control is transferred to when
the execution starts. </span></span><span style="font-style: normal"><span style="font-weight: normal">This
address must designate an object in the loaded code; otherwise, the
file is invalid and the parsing stops.</span></span></p>
<li><p style="line-height: 100%; margin-bottom: 0cm"><span style="font-style: normal"><span style="font-weight: normal">The
next </span></span><span style="font-style: normal"><span style="font-weight: normal">optional
</span></span><span style="font-style: normal"><span style="font-weight: normal">sequence
of </span></span><span style="font-style: normal"><span style="font-weight: normal">bytes
constitute</span></span><span style="font-style: normal"><span style="font-weight: normal">s</span></span><span style="font-style: normal"><span style="font-weight: normal">
the </span></span><i><span style="font-weight: normal">code</span></i><span style="font-style: normal"><span style="font-weight: normal">.</span></span></p>
</ul>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western"><a name="__RefHeading___Toc1034_225939230"></a>Annex
A. Extremely small file structure summary (informative)</h1>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<span style="font-style: normal">1 This annex </span><span style="font-style: normal">summarizes
the </span><i>extremely small</i><span style="font-style: normal">
file structure as described </span><span style="font-style: normal">in</span><span style="font-style: normal">
</span><span style="font-style: normal">4</span><span style="font-style: normal">.1
and </span><span style="font-style: normal">4</span><span style="font-style: normal">.2.</span></p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<span style="font-style: normal">2 </span><span style="font-style: normal">The
</span><i>extremely small executable</i><span style="font-style: normal">
file structure:</span></p>
<ul>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: magic number</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: specification version</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: alignment of the code</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: alignment of the heap</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
8 bytes: size of the heap</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
8 bytes: size of the stack</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
8 bytes: entry point</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
0 or more bytes: code</p>
</ul>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<span style="font-style: normal">3</span><span style="font-style: normal">
</span><span style="font-style: normal">The </span><i>extremely small
</i><i>loadable</i><span style="font-style: normal"> file structure:</span></p>
<ul>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: magic number</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: specification version</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: alignment of the code</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
4 bytes: padding</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
8 bytes: entry point</p>
<li><p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
0 or more bytes: code</p>
</ul>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<h1 class="western"><a name="__RefHeading___Toc973_1655514702"></a>Annex
B. Recommended practice (informative)</h1>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
1 This annex summarizes some practices that a practical interpreter
is expected to follow. This annex might be updated as new devices and
computer architectures are introduced.</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
2 Even though it is not explicitly stated in this standard, in a
practical interpreter, a byte may be composed of a sequence of bits.
The exact number of bits in a byte is not specified in this annex,
but for a practical intepreter to be conforming, a byte in such an
intepreter shall have at least 8 bits, considering each bit
contributes to the value of the result.</p>
<h1 class="western" style="page-break-before: always"><a name="__RefHeading___Toc1036_225939230"></a>
Contributions</h1>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
This specification would not have been possible without the
contributions of the following people:</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
<br/>
</p>
<p style="font-style: normal; font-weight: normal; line-height: 100%; margin-bottom: 0cm">
1 Somdipto Chakraborty</p>
<div id="sdfootnote1"><p class="sdfootnote"><a class="sdfootnotesym" name="sdfootnote1sym" href="#sdfootnote1anc">1</a>For
example, a processor might fetch intructions and <span style="font-style: normal">execut</span><span style="font-style: normal">e
them</span><span style="font-style: normal">.</span></p>
</div>
<div id="sdfootnote2"><p class="sdfootnote"><a class="sdfootnotesym" name="sdfootnote2sym" href="#sdfootnote2anc">2</a>This
is included to avoid endianness conflicts between the interpreter
and the writer.</p>
</div>
<div title="footer"><p style="line-height: 100%; margin-top: 0.5cm; margin-bottom: 0cm">
<span style="background: #c0c0c0"><sdfield type=PAGE subtype=RANDOM format=PAGE>9</sdfield></span></p>
</div>
</body>
</html>