-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTechnical_info.txt
1502 lines (1282 loc) · 51.9 KB
/
Technical_info.txt
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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
+---------------------------------------------------------------+
| interimcodes (tokens) |
+---------------------------------------------------------------+
[hint: if 16bit ref prob in EC then move big data tables to end of exe]
num type parameters
-1 . end_of_interim
0 . end_of_statement [EOI]
1 value [VALUE] v:LONG
2 *X libcall [LIBC] off_lib:INT, off_call:INT, regs:PTR,
movemmask:INT, exc:INT
3 *. "," [COM]
4 * ":=" [ASSIGN]
5 [X] ident [IDENT] id:PTR TO ident
6 string [STR] strlen:INT, wordlen:INT,
strdata[wordlen]:ARRAY OF INT
7 * "+" 11 * "=" 15 * "<="
8 * "-" 12 . ">" 16 "<>"
9 * "*" 13 * "<" 17 * "("
10 * "/" 14 * ">=" 18 . ")"
19 . ":"
20 <empty>
21 [] source_ptr line:INT, srclinenum
22 *X efunc entry:PTR TO tab
23 * "{"
24 "}"
25 const_resolved ascii:PTR TO STR, hashentry:LONG
26 ".W"
27 ".L"
28 ".B"
29 * "[" otherbracket:PTR TO
interim_after_closing_bracket
30 . "]"
31 X objecthead o:PTR TO objectheader
32 * "^"
33 "++"
34 "--"
35 * "."
36 * "`"
37 "!" [was "|"]
38 *X libcallparse l:PTR TO table
39 X objectmember o:PTR TO member
40 *. "<=>"
41 * "::"
42 X objmemberascii a:PTR TO STR (method+shared ONLY)
43 floatvalue v:LONG
44 dummy (skip) [only after $04xx tokens]
45 X objectheadascii a:PTR TO STR (mutrec PTR TO in objs)
46 . "|"
47 * "<<" shift left
48 * ">>" shift right
49 ?
50 :=: swap
51 +=,-=,*=,/=,<<=,>>=
52 expsizeof
creative
47 PPC
48 PPC
49 <<
50 >>
51 <<=, >>=, +=, -=, *= /= expression
52 ?
53 :=: swap
54 library function
55 ?
* = never end of stat
. = next token to decide if ">" is part of a LISP-cell
[]/X/@ = mac prob/save/prev_token (for tokenised macromethod)
NOTE: adding to this --> error reconstruction, skip etc.
from offset IOFF
| 0 * PROC | 1 ENDPROC | 2 * IF
| 3 ENDIF | 4 * VOID | 5 * WHILE
| 6 ENDWHILE | 7 * FOR | 8 ENDFOR
| 9 * SELECT | 10 * CASE | 11 DEFAULT
| 12 ENDSELECT | 13 REPEAT | 14 * UNTIL
| 15 * JUMP | 16 * DEF | 17 * LOCAL (=DEF)
| 18 . ELSE | 19 * INCBIN | 20 LONG
21 INT 22 CHAR 23 * INC
24 * DEC 25 *. THEN 26 LOOP
27 ENDLOOP 28 . DO 29 * AND
30 * OR 31 * CONST 32 * OPT
33 MODULE 34 STACK 35 EXIT
36 LARGE 37 ASM 38 NOWARN
39 * TO 40 * STEP 41 ARRAY
42 STRING 43 * DIR 44 * PTR
45 * OF 46 * ELSEIF 47 LIST
48 * OBJECT 49 ENDOBJECT | 50 * SIZEOF
| 51 RETURN | 52 * OSVERSION | 53 * ENUM
| 54 * SET | 55 *. BUT | 56 HANDLE
| 57 EXCEPT | 58 * RAISE | 59 EXPORT
60 REG 61 * END | 62 * IS
| 63 * NEW | 64 PUBLIC | 65 PRIVATE
| 66 SUPER | 67 PREPROCESS | 68 * LIBRARY
69 STRMERGE 70 NOALIGN 71 NOT
72 UNION 73 ENDUNION 74 SAFE
75 RUNBG 76 OLD 77 EXTRA
78 CONT 79 ANDALSO 80 ORELSE
81 POOL 82 PURE 83 FATAL
84 WARN 85 WITH 86 NOREGS
76 FPEXP 88 NOSTARTUP 89 UTILLIB
90 INLINE 91 ELSEWHILE 92 ALWAYS
93 SECTION 94 CODE 95 DATA
96 CHIP 97 FAST 98 OFFSETOF
99 TRY 100 CATCH 101 ENDTRY
102 UNTILN 103 WHILEN 104 ELSEWHILEN
105 IFN 106 ELSEIFN 107 EXITN
108 CONTN 109 BYTE 110 WORD
111 LEGACYINT 112 PSIZEOF 113 ARRAYSIZE
| = significant for idents
to change: INSTABLE, INSJOBTAB, PARSEUPPER, HEAVYTABLE,
CONTINUEKEY, PARSEGETIDENTNR, PARSEGETINSNR
+---------------------------------------------------------------+
| run-time variables |
+---------------------------------------------------------------+
those with "" are actual addressable variables
-4 stack return [sys]
-8 "stdout" [io]
-12 "conout" [io]
-16 "stdrast" [gfx]
-20 linked memory list:PTR TO mem [sys]
-24 exit jump code adr. [sys]
-28 cli return value [os]
-32 "arg" [os]
-36 "wbmessage" [os]
-40 "execbase" [base]
-44 "dosbase" [base]
-48 "intuitionbase" [base]
-52 "gfxbase" [base]
-56 "mathieeesingbasbase" [base] 97-101
-60 "mathieeesingtransbase" [base] 102-109
-64 stack bottom adr. [sys]
-66.W qualifier [intui]
-68.W code [intui]
-72 iaddress [intui]
-76 code_return [exc]
-80 stack_return [exc]
-84 "exception" [exc]
-88 saved a5 [exc]
-92 "stdin" [io]
-96 "exceptioninfo" [exc]
-100 chopmem [new]
-104 chopleft [new]
-108 cellsmem [gc]
-112 cellsfree [gc]
-116 chunksize [gc]
-120 "thistask" [sys]
-124 pool
-128 opened files list
-132 utilitybase
-136 rnd seed
+---------------------------------------------------------------+
| structures |
+---------------------------------------------------------------+
OBJECT ident_lex_parse
next:LONG -4
ascii:PTR TO STR 0
type:CHAR 4, [local,global,lab] = [1,2,3], 0=ndef
flags:CHAR 5
pr:PTR TO proc 6, [proc,NIL,proc]
info:INT 10
lineNUM:INT 12 (VARLINENO)
heavy:LONG VARHEAVY
varname VAR_NAME
ptrrepcount VAR_PTRREPCOUNT used to count ptr to ptr
dimdata VAR_DIMDATA used to track multi-dimensional arrays
ENDOBJECT
0/1 1/2 2/4 3/8 4/16 5/32 6/64 7/128
flags = SET USED,SYS_VAR,EXPORT (*),REG,REAL|METHOD,FORCEUNSIGNED(BYTE),FORCESIGNED(WORD), SIZE=LONG
(*) = in mainsource var komt uit module, variable coalescing
etype = PTR TO [1,2,4] | PTR TO <object>
info = [if_arg_then_offset,0,lab=-1 | proc=-2 | -3/-4 code in other module]
offset = +arg, -localvar
lineNUM = line number of declaration used in reporting unused variables
heavy: only for local+reg_alloc | labels from module [NIL|PTR TO procclass]
varname (used to save name when it is overwritten as etype in checkidents)
ptrrepcount - used to track number of PTR TO PTR references
dimdata - ptr to dim data used to track the dimensions of an array
OBJECT ident_parse_compile
next:LONG -4
etype:LONG 0, [type,type,ascii]
type:CHAR 4, [local,global,lab] = [1,2,3]
flags:CHAR 5
pr:PTR TO proc 6, [proc,PTR TO globinfo|NIL,proc|NIL if lab]
info:INT 10, [offset/regnum,offset,ID=label]
ENDOBJECT
OBJECT globinfo
ascii:PTR TO STR 0
used:PTR TO offsetinfo 4
ENDOBJECT
OBJECT offsetinfo
next:PTR TO offsetinfo 0
off:LONG 4 offset from code
opsize:INT 8 [1,2,4] (see GENGI)
ENDOBJECT
OBJECT proc
next:PTR TO proc -4
nrargs:INT 0
flags:CHAR 2, SET COMPILE_RTD,METHOD,NO_REGALLOC,HAS_TAB,SAFEPROC,NOREGS,FROMMOD
numregvars:CHAR 3, 0..3
nrloc:INT 4, -(nrloc*4)
defargs:PTR TO vallist 6
of_object:PTR TO objectheader 10
ident:PTR TO ident 14
self:PTR TO ident 18
method:PTR TO method 22
regtable:PTR TO LONG 26 if regalloc
ENDOBJECT
OBJECT const
cnext:PTR TO const hashed
cascii:PTR TO CHAR 4
cval:LONG 8
cflags:CHAR 12, bit 0=export
dummy:CHAR _empty_spot_
ENDOBJECT
OBJECT member
onext:PTR TO member -4
ooff:INT 0, offset
oflags:CHAR 2, SET PRIVATE,EXTRA_TYPED,UNION,FORCEUNSIGNED(BYTE),FORCESIGNED(WORD),LONG
dummy:CHAR 3, _empty_spot_
osize:INT 4, fieldsize [1,2,4,0=array]
oid:INT 6, object ID
oascii:PTR TO STR 8, NIL if PRIVATE
ptrrepcount 12 - PTRREPCOUNT used to count ptr to ptr
dimdata 14 - DIMDATA used to track multi-dimensional arrays
optrtype 18, if EXTRA_TYPED -+ asciiname ___ 0
info 22?, if ptr_to_obj -+ next
ENDOBJECT
types in OBJECT
till now: INT/CHAR/LONG/ARRAY/<obj>
extra: PTRTO/ARRAYOF INT/CHAR/LONG/<obj>
OBJECT objectheader
onext:PTR TO member -4
odel:INT 0, delegate size + IS_OO flag
otype:CHAR 2, flags: bit 0=export, 1=import , 2=unions
dummy:CHAR 3, _empty_spot_
osize:INT 4, sizeof object
oid:INT 6, object ID
oascii:PTR TO STR 8
omemb:PTR TO member 12, memberlist
omethod:PTR TO method 16, methodlist
osuper:PTR TO objecthead|NIL 20, superclass -> needed in main?
odelegatecode 24, initcode, NIL=not_here(MinM),
adr=here|1=no_del_whatsoever
oaccess:PTR TO access 28
odeloff:INT 32, offset from object (-1)
odestructoff 34, -1=none
ENDOBJECT
OBJECT access
next:PTR TO access 0
code:PTR 4, a4offset
type:INT 8, 0=a4 (new, build del), 1=dcode (link del)
ENDOBJECT
OBJECT method
m_next:PTR TO method 0
m_proc:PTR TO proc|NIL 4
m_type:CHAR 8 [0=METHOD, 1=FROZEN, 2=SHARED, 3=EMPTY]
m_flags:CHAR 9 SET INHERITED,ARGERR,DESTRUCTOR,PRIVATE
m_off:INT 10 delegate offset
m_name:PTR TO STR 12
ENDOBJECT
OBJECT modlist
mi_next:PTR TO modlist 0
mi_flags:CHAR 4 SET SECONDARY
mi_dummy 5 _empty_spot_
mi_namelen:LONG 6
mi_mod:PTR TO emodule 10
mi_list:PTR TO procclass 14
mi_nameptr:LONG 18
ENDOBJECT
OBJECT procclass
pc_next:PTR TO procclass 0
pc_type:INT 4 [1=class, 2=lab/proc]
pc_info:PTR 6 [TO ident|TO objectheader]
pc_acc:PTR TO modaccess 10 empty for class
ENDOBJECT
OBJECT modaccess
next, adr (adr=abs)
ENDOBJECT
OBJECT libasc
ascii:PTR (met direct erachter regs)
offset_base:INT b.v. -44
offset_func:INT b.v. -552
exception_index:INT -1=none
ENDOBJECT
OBJECT code_list fixproccode
next:PTR TO code_list
type:INT see # below:
1: OBJECT proc_offset
identptr:PTR 6
offset:LONG 10 from codeblock
ENDOBJECT
2: OBJECT code_block
adr:PTR 6
codebegin:LONG 10 if putreloc
ENDOBJECT
3: OBJECT reloc_block in putreloc
adr:PTR 6
len:LONG 10
ENDOBJECT
4: OBJECT adr_patch
adr:PTR 6
len:LONG 10
mod_vers:INT 14
ENDOBJECT
5: OBJECT proc_acc other proc access linking
name:STR 6 proc/lab
acc_list:PTR 10 [narg:INT,num:INT,LONG,...]
ENDOBJECT
6: OBJECT class
classname:STR 6
acclist:PTR 10 [INT,(LONG,INT),...]
ENDOBJECT
7: OBJECT classx
o:PTR TO obj 6
delcode:LONG 10
acclist:PTR 14
ENDOBJECT
8: OBJECT debug
next:PTR 6
d:PTR TO linedebug 10
offset:LONG 14
ENDOBJECT
ENDOBJECT
OBJECT string_link
next:PTR TO string_link
label:INT 4, link with this label#
first:LONG 6
ptrs:PTR TO list|NIL 10 [str,next]
-> was: numpointers:INT 6
-> pointers:ARRAY OF STR 8, each has wordlen at -2(p)
ENDOBJECT
OBJECT runtime_string_or_list
next:PTR TO runtime_bla
size:LONG total allocated mem
link:PTR TO string (here start non-dynamic version). maybe NIL
max:INT -4
len:INT -2
data[max+1]:ARRAY OF x 0
ENDOBJECT
OBJECT mem
next,alloc_size,actual_mem[]:ARRAY
ENDOBJECT
OBJECT efunctab
ascii:PTR TO STR NIL = endtab
code_begin:PTR code_end is code_begin of next tabentry
nrarg:LONG -(nrarg) --> vararg
defarginfos:LONG see: default arguments
ENDOBJECT
OBJECT branch
next:PTR TO branch
operand_adr:PTR
labelno:INT
linenum:INT
ENDOBJECT
OBJECT label
label_adr:PTR labelno is index on ARRAY OF label
ENDOBJECT
OBJECT reloc the odd reloc here and there
next,code
ENDOBJECT
OBJECT offslist track libbasevars
next, var
ENDOBJECT
OBJECT raiseinfo
comparatortoken:INT
exceptionval:LONG
testagainstval:LONG
ENDOBJECT
OBJECT debug
next:LONG 0
type:INT 4
1,2,3: arg/loc/glob vars
beginline:INT 6
num:INT 8
codes[num]:ARRAY OF INT 10 code = offset tov A5 | 30000+regnum
4: procname
num:INT 6
name[num]:ARRAY 8
5:
len:INT (cur = 4, for future extensions)
self_line:INT
self_code:INT
ENDOBJECT
-> preprocessor: #ifdef #ifndef #endif #define
OBJECT macro
next:PTR TO macro 0
name:PTR TO CHAR 4
body:PTR TO CHAR 8
nargs:INT 12
flags:CHAR 14 bit 0:import
dummy:CHAR 15
ENDOBJECT
OBJECT libinfo
name:STR 0
vers:LONG 4
rev:LONG 8
info:STR 12
dum:INT 16
numpr:INT 18
procs:ARRAY OF: 20
(20 bytes each:
OBJECT proclibinfo
i:PTR TO ident 0
regnums[12]:ARRAY OF CHAR 4
regs:INT 16 reverse movem
nargs:INT 18 if regs/nargs = -1:LONG not opp (no manual regs)
ENDOBJECT
...
NIL
ENDOBJECT
+---------------------------------------------------------------+
| statements job codes |
+---------------------------------------------------------------+
push,pop = keep track of this uitem on compile-stack (a5)
store = set to current variables
* = watch with variables
0 endjob
1* getlab, store {19}
2 getexp, make D0
3* getvar, store
4 getcomma
5 push ident
6 gen. newlab, push, store {15}
7 pop ident and check
8 unstore, make branch {6,21}
9 copy 2 bytes of jobcode to (a4)
10 as [9], for 4
11 as [9], for <n+1>*2 bytes
12 as [9], for 6
13 as [9], for 8
14 as [9], for 10
15 pop lab, define lab {6}
16 make <exp> in D0, or moveq [ENDPROC,RETURN]
17 proc on, check
18 proc off
19* get lab, check, define lab {1}
20 newlab, define lab, push {21}
21 pop lab, store {20,6}
22** unstore var, make offset (see also [35]), [all,source]
23* push varoffset (unstore)
24* pop varoffset (unstore)
25 push lab (unstore) {21}
26 push lab (store) [second set]
27 pop lab (store) [second set]
28 like [6] [second set]
29 like [8] [second set]
30 set flag=1
31 skip <n>+1 words if flag=0
32 set flag=0
33 do DEF/LOCAL/PROC: parse declarations
34 set size for LINK A5
35 like [22], now: move dest
36 get "("
37 get ")"
38 do INCBIN
39 do LONG
40 do INT
41 do CHAR
42 statement, recursively
43 IF nextcode is available (f.e. ELSE) THEN continue ELSE stop
44 cause syntax error
45 like [43], only now instead of stop eat until 0
46 skip one word of jobcode
47 expect ":="
48 expect TO
49 do mid-part of FOR
50 end global vars
51 make new endlab for IF (use with ELSEIF)
52 make branch to lab of [51]
53 define address
54 waiste lab
55 do OBJECT definition
56 IF case of [12], OPTIIF
57 set if-exp flag
58 do RETURN
59 like [8], but for 32bit reloc with BRA
60 version of [42] for IF <exp>
61 version of [2] for IF <exp> and WHILE, and REPEAT!
62 make STEP addq from stack
63 check for HANDLE after PROC
64 do EXCEPT
65 close exception handler in ENDPROC
66 push vartype
67 pop vartype
68 make RTS or RTD
69 do NEW
70 like 43, only now fixed for RETURN/IS
71 check and do SELECT OF
72 check for OF <object>
73 saveregs PROC (restore in job 18)
74 do END
75 fill EXIT label
76 do SUPER
77 DOUBLEIF block optimizer for : IF IF x THEN x=0 ELSE x=y THEN y
78 do INC/DEC (f.e. DEC x,10 )
79 EXPECT3
80 end job
81 end job
82 fill CONT label
83 do fatal error
84 do warn error
85 start new section
86 set iflag if statement matches following jobcode or clear iflag otherwise
87 invert immediately previous branch (eg beq becomes bne) if iflag is set
+---------------------------------------------------------------+
| OPT bits and cli-flags |
+---------------------------------------------------------------+
CODEPREFS
bit flags opt clear set
0 +3 - - STACK=<size> calc custom stack
1 - NILCHECK/S - - check "." and "[]" for NIL
2 l LARGE/S LARGE small large
3 a ASM/S ASM inline asm only
4 n NOWARN/S NOWARN warn no warnings
5 E ERRBYTE/S - 0/10 byte# errorspot
6 w WB/S - - wb_to_front
7 rX - REG DIY reg_alloc (max X regs)
8 0 +2 - - OSVERSION=<ver> v33 kick <ver>
9 1 b SHOWBUF/S - - show bufs
10 2 mX ADDBUF/N/K - add 1 add X
11 3 e ERRLINE/S - 0/10 line# errorspot
12 4 - - MODULE exe module
13 5 s SYM/S - - symbolhunk
14 6 - - EXPORT priv. exports all
15 7 q QUIET/S - messys quiet
16 0 +1 - - RTD use RTS use RTD for PROC call
17 1 c IGNORECACHE/S- cache don't use (ignore) cache
18 2 h HOLD/S - normal hold cli before cleanup
19 3 - - - don't use mathieeesingbas
20 4 - - - don't use mathieeesingtrans
21 5 L LINEDEBUG/S - - add line debug hunk
22 6 - DEBUG/S - - gen NOPs + linedebug + infos
23 7 - - PREPROCESS - macro def + use + condcompil
24 0 +0 - - STRMERGE - string merging
25 1 - - RUNBG
26 2 - - POOL - enable pool (v39+ only)
27 3 - - - auto close files
28 4 - - NOSTARTUP - stripped down startup
29 5 - - FPEXT - fpu
30 6 - - INLINE - enable inline functions
31 7 - - UTILLIB - uses utillib
STRMERGE - uses string merging
SOURCE/A
REG/N/K
OPTI/S (REG=5)
ICODEPREFS (ours)
bit flags opt clear set
0 +3
1
2 inline IF or ? operator in use
3
4
5 LEGACY produce old module version format 10 and no new system constants
6 LEGACYINT Int() function not sign extended
7
ICODEPREFS (creative - additional code prefs)
bit flags opt clear set
0 +3 SMALL
1 FAST
2 inline IF or ? operator in use
3 lastval is set
4 RUNBG
5 OPTI/S
6 CLEANUP cleanup
7 - - INLINE - enable inline functions
8 0 +2
9 1
10 2
11 3
12 4
13 5
14 6
15 7
16 0 +1
17 1
18 2
19 3
20 4
21 5
22 6
23 7
24 0 +0
25 1
26 2
27 3
28 4
29 5
30 6
31 7
+---------------------------------------------------------------+
| module format |
+---------------------------------------------------------------+
OBJECT emodule
"EMOD":LONG
firstjobcode:INT
0 EOF
1 OBJECT constdef
skipsize:LONG if vers>=6
-> any # until len=0
len:INT
value:LONG
id[len]:ARRAY
ENDOBJECT
2 OBJECT objectdef
skipsize:LONG if vers>=6
-> any # until len=0
len:INT if -1 then no id, private (only v4)
size:INT either membersize or -1 if objhead
offset:INT zero for objhead
id[len]:ARRAY
flags:INT if version>=13 (forcesigned and forceunsigned flags bits 0+1)
ptrrepcount:INT if version>=12 (count of PTR TO PTR)
dimdatacount:INT if version>=12 (number of array dimensions)
dimoffset:INT if version>=12 array dimension offset (repeated for each dimension above)
ptrtype:INT if vers>=6
[0=none,1=char,2=int,4=long,-1=obj]
len:INT if ptrtype=obj
name[len] of object type pointed to
ENDOBJECT
first one is always head, after last 0 follows totalize.w.
if -1, then then obj has nosize.
after totalsize (if vers>=7):
OBJECT classdef
odel:INT if 0 then no further infos
delcode:LONG offset
len:INT
superasc[len]:ARRAY -> not present for now
deloff:INT
destr:INT
-> any #of these until type+flags = $FFFF
type:CHAR
flags:CHAR
off:INT
len:INT
asc[len]:ARRAY methodname
nargs:INT
len:INT
defargs[len]:ARRAY OF LONG
arglen:INT /* GRIO */
argstring[arglen]:ARRAY if >0 /* GRIO */
-> any # until type = -1
type:INT access
off:LONG
ENDOBJECT
3 OBJECT codeblock
nr_of_longs:LONG
code[nr_of_longs]:ARRAY OF LONG
ENDOBJECT
4 OBJECT labeldefs -> any number of these, until len=-1
len:INT length string+zeroes in bytes
id[len]:ARRAY always even
offset:LONG
type:INT 1=proc, 2=lab
nrarg:INT from here only if proc!
nrloc:INT -(loc*4)
numdefargs:INT
defargs[num]:ARRAY OF LONG if >0
arglen:INT
argstring[arglen]:ARRAY if >0
ENDOBJECT
5 OBJECT sysparams always as first one in module !!!!!
stackused:LONG 0
osversion:INT 4
codeprefs:LONG 6
cpubitsets[3]:ARRAY OF INT 10, see elsewhere
modversion:INT 16 [ 0(=1),2,3,4,... ]
reserved:LONG 18
icodeprefs 22, if version>10 (creative)
ENDOBJECT
version 0 = no sysparams available, v2.1(b) with newer:
'could not read module'
1 = v2.3 .. v2.4b with newer: 'not right version'
2 = v2.4c+
3 = v2.4e+ (with globals)
4 = v2.4f+ (with private members)
5 = v2.6d+ (skips + module in module)
6 = v2.7b+ (const/obj skips + new types in objects)
7 = v2.7d+ (classes in modules)
8 = v3.0c+ (debuginfos)
9 = v3.1a+ (more debuginfos)
10 = v3.1b+ (fix opersize globals)
11 = creative
12 = v3.5.0 (PTR TO PTR types and Multi-dimensional arrays)
13 = v3.6.0 (add BYTE and WORD types)
14 = v3.8.0 (add regoffs to global variables)
6 LIBDEF
only available with version=0. after this modulechunk no others.
[1] libname, nilterm (only "\0" is ok too)
[2] basename (nilterm)
[3] any number of these until first byte = $FF
- chars funcname (not nil-term)
- register bytes [0..14] for args, if args=0 then byte 16
example: DC.B "Open",8,0,"Write",...,"FunNoArgs",16,"Bla",0,$FF
7 OBJECT relocinfos
numreloc:LONG
relocs[numreloc]:ARRAY OF LONG
ENDOBJECT
8 OBJECT globals
oldoffs:INT (vers>=14) original regoffs value (-1 also signals end) (***)
len:INT any #until len=-1 (*) (****)
ascii[len]:ARRAY if len>0
codeoff[]:ARRAY OF off (vers>=10)?(LONG,opersize:INT):LONG
NIL:LONG
ENDOBJECT
(*) also 0 for private globals
(***) version>=14 also $8000: next LONG is skipsize. real len follows (off=6)
(****) version<14 also $8000: next LONG is skipsize. real len follows (off=6)
9 OBJECT modinfo
skiplen:LONG
len:INT any #until len =0
name[len]:ARRAY
type:INT 0=end, 1=class, 2=lab/proc
len:INT
name[len]:ARRAY
2 narg:INT (-1=lab)
num:INT
access[num]:ARRAY OF LONG
1 num:INT
access[num]:ARRAY OF [LONG,INT]
ENDOBJECT
10 OBJECT debugvars
lineNum: INT
len:INT
regoffs[len]:INT
ENOBJECT
OBJECT debugvars2
lineNum: INT
len:INT
repeat len times
vartype:INT (see below)
oid:INT object id
dimcount:INT number of dimensions
dimsizes:ARRAY[dimcount] OF INT
namelen:INT (always padded to even length)
varname:ARRAY[namelen] OF CHAR
ENOBJECT
OBJECT objectdef
oid:INT
flags:CHAR
pad:CHAR
size:INT ;object size
len:INT
name[len]:ARRAY OF CHAR ; object name
repeat
membertype:INT
member oid:INT
member ooff:INT
dimcount:INT number of dimensions
dimsizes:ARRAY[dimcount] OF INT
len:INT
name[len]:ARRAY OF CHAR ; object name
membertype 0 (end)
ENDOBJECT
vartypes
0x01: CHAR
0x02: BYTE
0x03: INT
0x04: WORD
0x05: LONG
0x06: Object
0x21: PTR TO CHAR
0x22: PTR TO BYTE
0x23: PTR TO INT
0x24: PTR TO WORD
0x25: PTR TO LONG
0x26: PTR TO Object
0x27: PTR TO PTR
0x41: ARRAY OF CHAR
0x42: ARRAY OF BYTE
0x43: ARRAY OF INT
0x44: ARRAY OF WORD
0x45: ARRAY OF LONG
0x46: ARRAY OF Object
0x47: ARRAY OF PTR
0x61: ARRAY OF PTR TO CHAR
0x62: ARRAY OF PTR TO BYTE
0x63: ARRAY OF PTR TO INT
0x64: ARRAY OF PTR TO WORD
0x65: ARRAY OF PTR TO LONG
0x66: ARRAY OF PTR TO OBJECT
0x67: ARRAY OF PTR TO PTR
0xffff: Unknown
OBJECT selfdef
len:INT
lineNum:INT
regoffs:INT
ENDOBJECT
OBJECT debug_hunk
$3F1:LONG
len_from_here:LONG
0:LONG
"LINE"|"L"+offs|"EVAR":LONG
line -> len_name_in_longs:LONG
name[len]:ARRAY OF LONG
linedebug:ARRAY OF (linenum:LONG,offs:LONG)
evar -> job:INT (1..7)
1,2: local variables (see OBJECT debugvars)
3 global variables (see OBJECT debugvars)
4: len:INT, name[len]:ARRAY - proc definition
5: self definition (see object selfdef)
6 - var details (see OBJECT debugvars2)
7 - lineno:INT - proc details
8 - object definition (see OBJECT objectdef)
ENDOBJECT
11 OBJECT macros
len:INT until len=0
name[len]:ARRAY
nargs:INT
flags:CHAR
dummy:CHAR
len:INT
body[len]:ARRAY
ENDOBJECT
ENDOBJECT
0 1 2 skip
1 const r r [x] S [x]
2 object r r [x] r [ ]
3 codeblock r S [x] r [x] ok
4 lab/proc r M [x] r [x] -
5 sys r M [x] r [x] -
6 lib r r [x] S [x]
7 reloc r S [x] r [x] ok
8 glob r S [x] r [x] $8000
9 modinfo r [x] S [x] r [x] ok
10 debug r S r
11 macros r r S
0 = normal module in main source
2 = module from other module in main source
1 = module in module
S = Skip (often: INT mark, LONG bytes_to_skip_from_after_this_long
M = Special Action
+---------------------------------------------------------------+
| identifier parsing |
+---------------------------------------------------------------+
identifier predecessors:
object head TO OF : SIZEOF ::
object member .
local/glob/label other
OF outside of obj_def: ARRAY OF obj, SELECT var OF exp, PROC x() OF obj
+---------------------------------------------------------------+
| register assignments etc. |
+---------------------------------------------------------------+
TOKENIZE: a0 ptr to source
a1 ptr to interim codes
a2 ident work area
d4 last token before this one
d7/d6 current char, next char
COMPILE: (a2) during jobinterpret only
a3 interimcode
a4 asmcode
a5 compilerstack
EXP: a3-a5 from COMPILE
a1/d3/d4 set ins. / len opcode+operands
d5 -1=startexp, 0=op, 1=val
ASM_GRABVALUE: d0-d4/a0 thrashable
d0 wasvalue:BOOL
d1 if wasvalue then value
ASM_COMPILE: a3/a4 interim/code
a1 opcode
a0 jobcode
d1 size 1..3
a2/a5/a6 free
GETIDENTNR: a0-a2 like in PARSE
d3 PTR TO proc, (local) if any.
d5/a5 PTR TO ident
d5,a3/a4 freely used
ADDLABEL: d0 lab
a4 spot
a0/d0 trash
ADDBRANCH: a4 end.w instr
d0 label#
d1/a0 thrashable
NEWOP.W opcode for long version | NIL
ADDBRANCHRELOC: a4 voor rel. LONG
rest like ADDBRANCH without NEWOP
EADDRESSMODI: a1/d3-d5/d7 saved from EXP
d0 0 ea->d0
1 ea->d1
2 d0->ea