Subversion Repositories Kolibri OS

Rev

Rev 8097 | Rev 9177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8097 Rev 8859
Line 1... Line 1...
1
(*
1
(*
2
    BSD 2-Clause License
2
    BSD 2-Clause License
Line 3... Line 3...
3
 
3
 
4
    Copyright (c) 2018-2020, Anton Krotov
4
    Copyright (c) 2018-2021, Anton Krotov
5
    All rights reserved.
5
    All rights reserved.
Line 6... Line 6...
6
*)
6
*)
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
MODULE PROG;
8
MODULE PROG;
Line 9... Line 9...
9
 
9
 
Line 42... Line 42...
42
    sysWSADR*  = 39;  sysPUT32*  = 40;  (*sysNOP*   = 41;  sysEINT*  = 42;
42
    sysWSADR*  = 39;  sysPUT32*  = 40;  (*sysNOP*   = 41;  sysEINT*  = 42;
43
    sysDINT*   = 43;*)sysGET8*   = 44;  sysGET16* = 45;  sysGET32* = 46;
43
    sysDINT*   = 43;*)sysGET8*   = 44;  sysGET16* = 45;  sysGET32* = 46;
Line 44... Line 44...
44
 
44
 
45
    default32* =  2;  _default32* = default32 + 1;
45
    default32* =  2;  _default32* = default32 + 1;
46
    stdcall*   =  4;  _stdcall*   = stdcall + 1;
46
    stdcall*   =  4;  _stdcall*   = stdcall + 1;
47
    ccall*     =  6;  _ccall*     = ccall + 1;
47
    cdecl*     =  6;  _cdecl*     = cdecl + 1;
48
    ccall16*   =  8;  _ccall16*   = ccall16 + 1;
48
    ccall*     =  8;  _ccall*     = ccall + 1;
49
    win64*     = 10;  _win64*     = win64 + 1;
-
 
50
    stdcall64* = 12;  _stdcall64* = stdcall64 + 1;
49
    win64*     = 10;  _win64*     = win64 + 1;
51
    default64* = 14;  _default64* = default64 + 1;
50
    default64* = 12;  _default64* = default64 + 1;
52
    systemv*   = 16;  _systemv*   = systemv + 1;
51
    systemv*   = 14;  _systemv*   = systemv + 1;
53
    default16* = 18;
52
    default16* = 16;  _default16* = default16 + 1;
Line 54... Line 53...
54
    code*      = 20;  _code*      = code + 1;
53
    code*      = 18;  _code*      = code + 1;
Line 55... Line 54...
55
 
54
 
Line 56... Line 55...
56
    noalign* = 22;
55
    noalign* = 22;
57
 
56
 
58
    callee_clean_up* = {default32, stdcall, _stdcall, default64, stdcall64, _stdcall64};
57
    callee_clean_up* = {default32, _default32, stdcall, _stdcall, default64, _default64};
59
 
58
 
Line 60... Line 59...
60
    sf_stdcall* =  0; sf_stdcall64* = 1; sf_ccall*   = 2; sf_ccall16* = 3;
59
    sf_stdcall* =  0; sf_oberon*    = 1; sf_cdecl*   = 2; sf_ccall*  = 3;
61
    sf_win64*   =  4; sf_systemv*   = 5; sf_windows* = 6; sf_linux*   = 7;
60
    sf_win64*   =  4; sf_systemv*   = 5; sf_windows* = 6; sf_linux*  = 7;
Line 62... Line 61...
62
    sf_code*    =  8; sf_oberon*    = 9;
61
    sf_code*    =  8;
Line 113... Line 112...
113
 
112
 
Line 114... Line 113...
114
    END;
113
    END;
Line -... Line 114...
-
 
114
 
115
 
115
    rUNIT = RECORD (LISTS.ITEM)
116
    rUNIT = RECORD (LISTS.ITEM)
116
 
117
 
117
        fname*:      PATHS.PATH;
118
        name*:       SCAN.IDENT;
118
        name*:       SCAN.IDENT;
119
        idents*:     LISTS.LIST;
119
        idents*:     LISTS.LIST;
Line 212... Line 212...
212
    DELIMPORT = PROCEDURE (_import: LISTS.ITEM);
212
    DELIMPORT = PROCEDURE (_import: LISTS.ITEM);
Line 213... Line 213...
213
 
213
 
Line 214... Line 214...
214
 
214
 
215
VAR
215
VAR
216
 
216
 
Line 217... Line 217...
217
    LowerCase: BOOLEAN;
217
    LowerCase*: BOOLEAN;
Line 298... Line 298...
298
 
298
 
299
    unit.closed := TRUE
299
    unit.closed := TRUE
Line -... Line 300...
-
 
300
END closeUnit;
-
 
301
 
-
 
302
 
-
 
303
PROCEDURE IdEq* (a, b: SCAN.IDENT): BOOLEAN;
-
 
304
    RETURN (a.hash = b.hash) & (a.s = b.s)
300
END closeUnit;
305
END IdEq;
301
 
306
 
302
 
307
 
Line 303... Line 308...
303
PROCEDURE unique (unit: UNIT; ident: SCAN.IDENT): BOOLEAN;
308
PROCEDURE unique (unit: UNIT; ident: SCAN.IDENT): BOOLEAN;
304
VAR
-
 
305
    item: IDENT;
-
 
306
 
309
VAR
307
BEGIN
310
    item: IDENT;
308
    ASSERT(ident # NIL);
311
 
309
 
312
BEGIN
Line 310... Line 313...
310
    item := unit.idents.last(IDENT);
313
    item := unit.idents.last(IDENT);
311
    WHILE (item.typ # idGUARD) & (item.name # ident) DO
314
    WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
Line 322... Line 325...
322
    res:   BOOLEAN;
325
    res:   BOOLEAN;
323
    proc:  PROC;
326
    proc:  PROC;
Line 324... Line 327...
324
 
327
 
325
BEGIN
328
BEGIN
326
    ASSERT(unit # NIL);
-
 
Line 327... Line 329...
327
    ASSERT(ident # NIL);
329
    ASSERT(unit # NIL);
Line 328... Line 330...
328
 
330
 
329
    res := unique(unit, ident);
331
    res := unique(unit, ident);
Line 408... Line 410...
408
PROCEDURE getIdent* (unit: UNIT; ident: SCAN.IDENT; currentScope: BOOLEAN): IDENT;
410
PROCEDURE getIdent* (unit: UNIT; ident: SCAN.IDENT; currentScope: BOOLEAN): IDENT;
409
VAR
411
VAR
410
    item: IDENT;
412
    item: IDENT;
Line 411... Line 413...
411
 
413
 
412
BEGIN
-
 
413
    ASSERT(ident # NIL);
-
 
414
 
414
BEGIN
Line 415... Line 415...
415
    item := unit.idents.last(IDENT);
415
    item := unit.idents.last(IDENT);
Line 416... Line 416...
416
 
416
 
417
    IF item # NIL THEN
417
    IF item # NIL THEN
418
 
418
 
419
        IF currentScope THEN
419
        IF currentScope THEN
420
            WHILE (item.name # ident) & (item.typ # idGUARD) DO
420
            WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
421
                item := item.prev(IDENT)
421
                item := item.prev(IDENT)
422
            END;
422
            END;
423
            IF item.name # ident THEN
423
            IF item.typ = idGUARD THEN
424
                item := NIL
424
                item := NIL
425
            END
425
            END
426
        ELSE
426
        ELSE
427
            WHILE (item # NIL) & (item.name # ident) DO
427
            WHILE (item # NIL) & ~IdEq(item.name, ident) DO
Line 428... Line 428...
428
                item := item.prev(IDENT)
428
                item := item.prev(IDENT)
Line 450... Line 450...
450
        unit.scopes[unit.scopeLvl] := proc;
450
        unit.scopes[unit.scopeLvl] := proc;
Line 451... Line 451...
451
 
451
 
452
        NEW(item);
452
        NEW(item);
Line 453... Line 453...
453
        item := NewIdent();
453
        item := NewIdent();
-
 
454
 
454
 
455
        item.name.s := "";
Line 455... Line 456...
455
        item.name := NIL;
456
        item.name.hash := 0;
456
        item.typ  := idGUARD;
457
        item.typ  := idGUARD;
Line 457... Line 458...
457
 
458
 
458
        LISTS.push(unit.idents, item)
459
        LISTS.push(unit.idents, item)
Line 459... Line 460...
459
    END
460
    END
460
 
461
 
461
    RETURN res
462
    RETURN res
462
END openScope;
463
END openScope;
463
 
-
 
Line 464... Line 464...
464
 
464
 
465
PROCEDURE closeScope* (unit: UNIT; variables: LISTS.LIST);
465
 
Line 466... Line 466...
466
VAR
466
PROCEDURE closeScope* (unit: UNIT);
467
    item: IDENT;
467
VAR
468
    del:  IDENT;
468
    item: IDENT;
469
    lvar: IL.LOCALVAR;
469
    del:  IDENT;
470
 
470
 
471
BEGIN
471
BEGIN
472
    item := unit.idents.last(IDENT);
-
 
473
 
-
 
474
    WHILE (item # NIL) & (item.typ # idGUARD) DO
-
 
475
        del  := item;
-
 
476
        item := item.prev(IDENT);
-
 
477
        IF (del.typ = idVAR) & (del.offset = -1) THEN
-
 
478
            ERRORS.HintMsg(del.name.s, del.pos.line, del.pos.col, 0)
-
 
479
        END;
-
 
480
        IF (variables # NIL) & (del.typ IN {idVAR, idPARAM}) & (del.offset # -1) THEN
-
 
481
            IF del._type.typ IN BASICTYPES - {tREAL} + {tPOINTER, tPROCEDURE} THEN
-
 
482
                lvar := IL.NewVar();
-
 
483
                lvar.offset := del.offset;
472
    item := unit.idents.last(IDENT);
484
                lvar.size   := del._type.size;
473
 
485
                IF del.typ = idVAR THEN
474
    WHILE (item # NIL) & (item.typ # idGUARD) DO
Line 486... Line 475...
486
                    lvar.offset := -lvar.offset
475
        del  := item;
Line 506... Line 495...
506
    newptr: FRWPTR;
495
    newptr: FRWPTR;
Line 507... Line 496...
507
 
496
 
508
BEGIN
497
BEGIN
509
    ASSERT(unit # NIL);
498
    ASSERT(unit # NIL);
510
    ASSERT(_type # NIL);
-
 
Line 511... Line 499...
511
    ASSERT(baseIdent # NIL);
499
    ASSERT(_type # NIL);
Line 512... Line 500...
512
 
500
 
513
    NEW(newptr);
501
    NEW(newptr);
Line 624... Line 612...
624
            ~isOpenArray(src.base) & ~isOpenArray(dst.base) &
612
            ~isOpenArray(src.base) & ~isOpenArray(dst.base) &
625
            isTypeEq(src.base, dst.base)
613
            isTypeEq(src.base, dst.base)
626
END arrcomp;
614
END arrcomp;
Line 627... Line 615...
627
 
615
 
628
 
616
 
629
PROCEDURE getUnit* (name: SCAN.IDENT): UNIT;
617
PROCEDURE getUnit* (name: PATHS.PATH): UNIT;
Line 630... Line 618...
630
VAR
618
VAR
631
    item: UNIT;
-
 
632
 
-
 
633
BEGIN
619
    item: UNIT;
Line 634... Line 620...
634
    ASSERT(name # NIL);
620
 
635
 
621
BEGIN
636
    item := program.units.first(UNIT);
622
    item := program.units.first(UNIT);
Line 637... Line 623...
637
 
623
 
638
    WHILE (item # NIL) & (item.name # name) DO
624
    WHILE (item # NIL) & (item.fname # name) DO
639
        item := item.next(UNIT)
625
        item := item.next(UNIT)
Line 640... Line 626...
640
    END;
626
    END;
641
 
627
 
Line 642... Line 628...
642
    IF (item = NIL) & ((name.s = "SYSTEM") OR LowerCase & (name.s = "system")) THEN
628
    IF (item = NIL) & ((name = "SYSTEM") OR LowerCase & (name = "system")) THEN
Line 643... Line 629...
643
        item := program.sysunit
629
        item := program.sysunit
644
    END
630
    END
645
 
631
 
646
    RETURN item
632
    RETURN item
-
 
633
END getUnit;
Line 647... Line 634...
647
END getUnit;
634
 
648
 
635
 
-
 
636
PROCEDURE enterStTypes (unit: UNIT);
649
 
637
 
650
PROCEDURE enterStTypes (unit: UNIT);
638
 
651
 
639
    PROCEDURE enter (unit: UNIT; nameStr: SCAN.IDSTR; _type: _TYPE);
652
 
640
    VAR
653
    PROCEDURE enter (unit: UNIT; name: SCAN.LEXSTR; _type: _TYPE);
641
        ident: IDENT;
-
 
642
        upper: SCAN.IDSTR;
654
    VAR
643
        name:  SCAN.IDENT;
655
        ident: IDENT;
644
 
656
        upper: SCAN.LEXSTR;
645
    BEGIN
Line 657... Line 646...
657
 
646
        IF LowerCase THEN
Line 685... Line 674...
685
 
674
 
Line 686... Line -...
686
 
-
 
687
PROCEDURE enterStProcs (unit: UNIT);
-
 
688
 
-
 
689
 
-
 
690
    PROCEDURE EnterProc (unit: UNIT; name: SCAN.LEXSTR; proc: INTEGER);
-
 
691
    VAR
-
 
692
        ident: IDENT;
-
 
693
        upper: SCAN.LEXSTR;
-
 
694
 
-
 
695
    BEGIN
-
 
696
        IF LowerCase THEN
-
 
697
            ident := addIdent(unit, SCAN.enterid(name), idSTPROC);
-
 
698
            ident.stproc := proc;
-
 
699
            ident._type := program.stTypes.tNONE
-
 
700
        END;
-
 
701
        upper := name;
-
 
702
        STRINGS.UpCase(upper);
-
 
703
        ident := addIdent(unit, SCAN.enterid(upper), idSTPROC);
-
 
704
        ident.stproc := proc;
-
 
705
        ident._type := program.stTypes.tNONE
675
 
706
    END EnterProc;
676
PROCEDURE enterStProcs (unit: UNIT);
707
 
677
 
708
 
678
 
-
 
679
    PROCEDURE Enter (unit: UNIT; nameStr: SCAN.IDSTR; nfunc, tfunc: INTEGER);
Line 709... Line 680...
709
    PROCEDURE EnterFunc (unit: UNIT; name: SCAN.LEXSTR; func: INTEGER);
680
    VAR
710
    VAR
681
        ident: IDENT;
-
 
682
        upper: SCAN.IDSTR;
711
        ident: IDENT;
683
        name:  SCAN.IDENT;
712
        upper: SCAN.LEXSTR;
684
 
713
 
685
    BEGIN
714
    BEGIN
686
        IF LowerCase THEN
715
        IF LowerCase THEN
687
            SCAN.setIdent(name, nameStr);
716
            ident := addIdent(unit, SCAN.enterid(name), idSTFUNC);
688
            ident := addIdent(unit, name, tfunc);
-
 
689
            ident.stproc := nfunc;
717
            ident.stproc := func;
690
            ident._type := program.stTypes.tNONE
718
            ident._type := program.stTypes.tNONE
691
        END;
719
        END;
692
        upper := nameStr;
720
        upper := name;
693
        STRINGS.UpCase(upper);
Line 721... Line 694...
721
        STRINGS.UpCase(upper);
694
        SCAN.setIdent(name, upper);
722
        ident := addIdent(unit, SCAN.enterid(upper), idSTFUNC);
695
        ident := addIdent(unit, name, tfunc);
723
        ident.stproc := func;
696
        ident.stproc := nfunc;
724
        ident._type := program.stTypes.tNONE
697
        ident._type := program.stTypes.tNONE
725
    END EnterFunc;
698
    END Enter;
726
 
699
 
727
 
700
 
728
BEGIN
701
BEGIN
729
    EnterProc(unit, "assert", stASSERT);
702
    Enter(unit, "assert", stASSERT, idSTPROC);
730
    EnterProc(unit, "dec",    stDEC);
703
    Enter(unit, "dec",    stDEC,    idSTPROC);
731
    EnterProc(unit, "excl",   stEXCL);
704
    Enter(unit, "excl",   stEXCL,   idSTPROC);
732
    EnterProc(unit, "inc",    stINC);
705
    Enter(unit, "inc",    stINC,    idSTPROC);
733
    EnterProc(unit, "incl",   stINCL);
706
    Enter(unit, "incl",   stINCL,   idSTPROC);
734
    EnterProc(unit, "new",    stNEW);
707
    Enter(unit, "new",    stNEW,    idSTPROC);
735
    EnterProc(unit, "copy",   stCOPY);
708
    Enter(unit, "copy",   stCOPY,   idSTPROC);
736
 
709
 
737
    EnterFunc(unit, "abs",    stABS);
710
    Enter(unit, "abs",    stABS,    idSTFUNC);
738
    EnterFunc(unit, "asr",    stASR);
711
    Enter(unit, "asr",    stASR,    idSTFUNC);
739
    EnterFunc(unit, "chr",    stCHR);
712
    Enter(unit, "chr",    stCHR,    idSTFUNC);
740
    EnterFunc(unit, "len",    stLEN);
713
    Enter(unit, "len",    stLEN,    idSTFUNC);
741
    EnterFunc(unit, "lsl",    stLSL);
714
    Enter(unit, "lsl",    stLSL,    idSTFUNC);
742
    EnterFunc(unit, "odd",    stODD);
715
    Enter(unit, "odd",    stODD,    idSTFUNC);
Line 743... Line 716...
743
    EnterFunc(unit, "ord",    stORD);
716
    Enter(unit, "ord",    stORD,    idSTFUNC);
744
    EnterFunc(unit, "ror",    stROR);
717
    Enter(unit, "ror",    stROR,    idSTFUNC);
745
    EnterFunc(unit, "bits",   stBITS);
718
    Enter(unit, "bits",   stBITS,   idSTFUNC);
746
    EnterFunc(unit, "lsr",    stLSR);
719
    Enter(unit, "lsr",    stLSR,    idSTFUNC);
747
    EnterFunc(unit, "length", stLENGTH);
720
    Enter(unit, "length", stLENGTH, idSTFUNC);
748
    EnterFunc(unit, "min",    stMIN);
721
    Enter(unit, "min",    stMIN,    idSTFUNC);
Line 749... Line 722...
749
    EnterFunc(unit, "max",    stMAX);
722
    Enter(unit, "max",    stMAX,    idSTFUNC);
750
 
723
 
751
    IF TARGETS.RealSize # 0 THEN
724
    IF TARGETS.RealSize # 0 THEN
Line 752... Line 725...
752
        EnterProc(unit, "pack",  stPACK);
725
        Enter(unit, "pack",  stPACK,  idSTPROC);
753
        EnterProc(unit, "unpk",  stUNPK);
726
        Enter(unit, "unpk",  stUNPK,  idSTPROC);
754
        EnterFunc(unit, "floor", stFLOOR);
727
        Enter(unit, "floor", stFLOOR, idSTFUNC);
Line 755... Line 728...
755
        EnterFunc(unit, "flt",   stFLT)
728
        Enter(unit, "flt",   stFLT,   idSTFUNC)
Line 756... Line 729...
756
    END;
729
    END;
757
 
730
 
758
    IF TARGETS.BitDepth >= 32 THEN
731
    IF TARGETS.BitDepth >= 32 THEN
Line 759... Line 732...
759
        EnterFunc(unit, "wchr", stWCHR)
732
        Enter(unit, "wchr", stWCHR, idSTFUNC)
760
    END;
-
 
761
 
-
 
762
    IF TARGETS.Dispose THEN
733
    END;
Line 763... Line 734...
763
        EnterProc(unit, "dispose", stDISPOSE)
734
 
764
    END
735
    IF TARGETS.Dispose THEN
765
 
736
        Enter(unit, "dispose", stDISPOSE, idSTPROC)
Line 808... Line 779...
808
VAR
779
VAR
809
    field: FIELD;
780
    field: FIELD;
Line 810... Line 781...
810
 
781
 
811
BEGIN
782
BEGIN
812
    ASSERT(self # NIL);
-
 
813
    ASSERT(name # NIL);
783
    ASSERT(self # NIL);
Line 814... Line 784...
814
    ASSERT(unit # NIL);
784
    ASSERT(unit # NIL);
815
 
785
 
Line 816... Line 786...
816
    field := NIL;
786
    field := NIL;
Line 817... Line 787...
817
    WHILE (self # NIL) & (field = NIL) DO
787
    WHILE (self # NIL) & (field = NIL) DO
818
 
788
 
819
        field := self.fields.first(FIELD);
789
        field := self.fields.first(FIELD);
Line 820... Line 790...
820
 
790
 
821
        WHILE (field # NIL) & (field.name # name) DO
791
        WHILE (field # NIL) & ~IdEq(field.name, name) DO
Line 840... Line 810...
840
VAR
810
VAR
841
    field: FIELD;
811
    field: FIELD;
842
    res:   BOOLEAN;
812
    res:   BOOLEAN;
Line 843... Line 813...
843
 
813
 
844
BEGIN
-
 
845
    ASSERT(name # NIL);
-
 
846
 
814
BEGIN
Line 847... Line 815...
847
    res := getField(self, name, self.unit) = NIL;
815
    res := getField(self, name, self.unit) = NIL;
848
 
816
 
Line 899... Line 867...
899
PROCEDURE getParam* (self: _TYPE; name: SCAN.IDENT): PARAM;
867
PROCEDURE getParam* (self: _TYPE; name: SCAN.IDENT): PARAM;
900
VAR
868
VAR
901
    item: PARAM;
869
    item: PARAM;
Line 902... Line 870...
902
 
870
 
903
BEGIN
-
 
904
    ASSERT(name # NIL);
-
 
905
 
871
BEGIN
Line 906... Line 872...
906
    item := self.params.first(PARAM);
872
    item := self.params.first(PARAM);
907
 
873
 
908
    WHILE (item # NIL) & (item.name # name) DO
874
    WHILE (item # NIL) & ~IdEq(item.name, name) DO
Line 909... Line 875...
909
        item := item.next(PARAM)
875
        item := item.next(PARAM)
910
    END
876
    END
Line 917... Line 883...
917
VAR
883
VAR
918
    param: PARAM;
884
    param: PARAM;
919
    res:   BOOLEAN;
885
    res:   BOOLEAN;
Line 920... Line 886...
920
 
886
 
921
BEGIN
-
 
922
    ASSERT(name # NIL);
-
 
923
 
887
BEGIN
Line 924... Line 888...
924
    res := getParam(self, name) = NIL;
888
    res := getParam(self, name) = NIL;
925
 
889
 
Line 1099... Line 1063...
1099
 
1063
 
1100
PROCEDURE createSysUnit;
1064
PROCEDURE createSysUnit;
1101
VAR
1065
VAR
1102
    ident: IDENT;
1066
    ident: IDENT;
-
 
1067
    unit:  UNIT;
Line 1103... Line 1068...
1103
    unit:  UNIT;
1068
    name:  SCAN.IDENT;
1104
 
1069
 
1105
 
1070
 
1106
    PROCEDURE EnterProc (sys: UNIT; name: SCAN.LEXSTR; idtyp, proc: INTEGER);
1071
    PROCEDURE EnterProc (sys: UNIT; nameStr: SCAN.IDSTR; idtyp, proc: INTEGER);
-
 
1072
    VAR
Line 1107... Line 1073...
1107
    VAR
1073
        ident: IDENT;
1108
        ident: IDENT;
1074
        upper: SCAN.IDSTR;
-
 
1075
        name:  SCAN.IDENT;
1109
        upper: SCAN.LEXSTR;
1076
 
1110
 
1077
    BEGIN
1111
    BEGIN
1078
        IF LowerCase THEN
1112
        IF LowerCase THEN
1079
            SCAN.setIdent(name, nameStr);
1113
            ident := addIdent(sys, SCAN.enterid(name), idtyp);
1080
            ident := addIdent(sys, name, idtyp);
1114
            ident.stproc := proc;
1081
            ident.stproc := proc;
1115
            ident._type := program.stTypes.tNONE;
1082
            ident._type := program.stTypes.tNONE;
-
 
1083
            ident.export := TRUE
1116
            ident.export := TRUE
1084
        END;
1117
        END;
1085
        upper := nameStr;
1118
        upper := name;
1086
        STRINGS.UpCase(upper);
1119
        STRINGS.UpCase(upper);
1087
        SCAN.setIdent(name, upper);
1120
        ident := addIdent(sys, SCAN.enterid(upper), idtyp);
1088
        ident := addIdent(sys, name, idtyp);
Line 1121... Line 1089...
1121
        ident.stproc := proc;
1089
        ident.stproc := proc;
-
 
1090
        ident._type := program.stTypes.tNONE;
1122
        ident._type := program.stTypes.tNONE;
1091
        ident.export := TRUE
-
 
1092
    END EnterProc;
Line 1123... Line 1093...
1123
        ident.export := TRUE
1093
 
1124
    END EnterProc;
1094
 
1125
 
1095
BEGIN
1126
 
1096
    SCAN.setIdent(name, "$SYSTEM");
Line 1159... Line 1129...
1159
        EnterProc(unit, "put32",  idSYSPROC, sysPUT32);
1129
        EnterProc(unit, "put32",  idSYSPROC, sysPUT32);
1160
        EnterProc(unit, "get16",  idSYSPROC, sysGET16);
1130
        EnterProc(unit, "get16",  idSYSPROC, sysGET16);
1161
        EnterProc(unit, "get32",  idSYSPROC, sysGET32);
1131
        EnterProc(unit, "get32",  idSYSPROC, sysGET32);
Line 1162... Line 1132...
1162
 
1132
 
-
 
1133
        IF LowerCase THEN
1163
        IF LowerCase THEN
1134
            SCAN.setIdent(name, "card32");
1164
            ident := addIdent(unit, SCAN.enterid("card32"), idTYPE);
1135
            ident := addIdent(unit, name, idTYPE);
1165
            ident._type := program.stTypes.tCARD32;
1136
            ident._type := program.stTypes.tCARD32;
1166
            ident.export := TRUE
1137
            ident.export := TRUE
-
 
1138
        END;
1167
        END;
1139
        SCAN.setIdent(name, "CARD32");
1168
        ident := addIdent(unit, SCAN.enterid("CARD32"), idTYPE);
1140
        ident := addIdent(unit, name, idTYPE);
1169
        ident._type := program.stTypes.tCARD32;
1141
        ident._type := program.stTypes.tCARD32;
1170
        ident.export := TRUE;
1142
        ident.export := TRUE;
Line 1171... Line 1143...
1171
    END;
1143
    END;
Line 1245... Line 1217...
1245
    UTILS.SetBitDepth(TARGETS.BitDepth, TARGETS.RealSize = 8);
1217
    UTILS.SetBitDepth(TARGETS.BitDepth, TARGETS.RealSize = 8);
Line 1246... Line 1218...
1246
 
1218
 
Line 1247... Line 1219...
1247
    program.options := options;
1219
    program.options := options;
1248
 
1220
 
1249
    CASE TARGETS.OS OF
1221
    CASE TARGETS.OS OF
1250
    |TARGETS.osWIN32:    program.sysflags := {sf_oberon, sf_windows, sf_stdcall, sf_ccall, sf_ccall16, sf_noalign}
1222
    |TARGETS.osWIN32:    program.sysflags := {sf_oberon, sf_windows, sf_stdcall, sf_cdecl, sf_ccall, sf_noalign}
1251
    |TARGETS.osLINUX32:  program.sysflags := {sf_oberon, sf_linux, sf_stdcall, sf_ccall, sf_ccall16, sf_noalign}
1223
    |TARGETS.osLINUX32:  program.sysflags := {sf_oberon, sf_linux, sf_stdcall, sf_cdecl, sf_ccall, sf_noalign}
1252
    |TARGETS.osKOS:      program.sysflags := {sf_oberon, sf_stdcall, sf_ccall, sf_ccall16, sf_noalign}
1224
    |TARGETS.osKOS:      program.sysflags := {sf_oberon, sf_stdcall, sf_cdecl, sf_ccall, sf_noalign}
1253
    |TARGETS.osWIN64:    program.sysflags := {sf_oberon, sf_windows, sf_stdcall64, sf_win64, sf_systemv, sf_noalign}
1225
    |TARGETS.osWIN64:    program.sysflags := {sf_oberon, sf_windows, sf_win64, sf_systemv, sf_ccall, sf_noalign}
1254
    |TARGETS.osLINUX64:  program.sysflags := {sf_oberon, sf_linux, sf_stdcall64, sf_win64, sf_systemv, sf_noalign}
1226
    |TARGETS.osLINUX64:  program.sysflags := {sf_oberon, sf_linux, sf_win64, sf_systemv, sf_ccall, sf_noalign}
Line 1255... Line 1227...
1255
    |TARGETS.osNONE:     program.sysflags := {sf_code}
1227
    |TARGETS.osNONE:     program.sysflags := {sf_code}
1256
    END;
1228
    END;