Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 9872 → Rev 9873

/programs/develop/oberon07/Compiler
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/develop/oberon07/SelfKolibriOS.cmd
File deleted
\ No newline at end of file
/programs/develop/oberon07/README.md
File deleted
/programs/develop/oberon07/Compiler.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/develop/oberon07/Compiler.kex
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/develop/oberon07/LICENSE
1,25 → 1,25
BSD 2-Clause License
 
Copyright (c) 2018-2021, Anton Krotov
All rights reserved.
 
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
 
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
 
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
BSD 2-Clause License
 
Copyright (c) 2018-2022, Anton Krotov
All rights reserved.
 
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
 
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
 
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/programs/develop/oberon07/lib/RVMxI/32/HOST.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/32/RTL.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/32/Trap.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/32/Out.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/32/FPU.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/64/Trap.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/64/Out.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/64/HOST.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVMxI/64/RTL.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVM32I/HOST.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVM32I/RTL.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVM32I/Trap.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVM32I/Out.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/RVM32I/FPU.ob07
File deleted
\ No newline at end of file
/programs/develop/oberon07/lib/KolibriOS/HOST.ob07
1,7 → 1,7
(*
BSD 2-Clause License
 
Copyright (c) 2018-2021, Anton Krotov
Copyright (c) 2018-2022, Anton Krotov
All rights reserved.
*)
 
59,7 → 59,7
Params: ARRAY MAX_PARAM, 2 OF INTEGER;
argc*: INTEGER;
 
maxreal*: REAL;
maxreal*, inf*: REAL;
 
 
PROCEDURE [stdcall, "Console.obj", "con_init"] con_init (wnd_width, wnd_height, scr_width, scr_height, title: INTEGER);
537,6 → 537,7
END
END;
 
inf := SYSTEM.INF();
maxreal := 1.9;
PACK(maxreal, 1023);
Console := TRUE;
/programs/develop/oberon07/source/UTILS.ob07
23,8 → 23,8
max32* = 2147483647;
 
vMajor* = 1;
vMinor* = 56;
Date* = "21-jun-2022";
vMinor* = 57;
Date* = "31-aug-2022";
 
FILE_EXT* = ".ob07";
RTL_NAME* = "RTL";
36,7 → 36,7
 
time*: INTEGER;
 
maxreal*: REAL;
maxreal*, inf*: REAL;
 
target*:
 
212,5 → 212,6
 
BEGIN
time := HOST.GetTickCount();
inf := HOST.inf;
maxreal := HOST.maxreal
END UTILS.
/programs/develop/oberon07/source/X86.ob07
94,13 → 94,15
 
CodeList: LISTS.LIST;
 
tcount: INTEGER;
tcount, LocVarSize, mainLocVarSize: INTEGER;
 
FR: ARRAY 1000 OF INTEGER;
 
fname: PATHS.PATH;
 
FltConstLabel, mainFltConstLabel: LABEL;
 
 
PROCEDURE OutByte* (n: BYTE);
VAR
c: CODE;
399,6 → 401,40
END Reloc;
 
 
PROCEDURE PushFlt (label: LABEL; value: REAL);
VAR
a, b, n: INTEGER;
 
 
PROCEDURE pushImm (label: LABEL; value: INTEGER);
VAR
c: CODE;
i: INTEGER;
 
BEGIN
NEW(c);
IF isByte(value) THEN
c.code[0] := 6AH;
c.code[1] := value MOD 256;
c.length := 2
ELSE
c.code[0] := 68H;
FOR i := 1 TO 4 DO
c.code[i] := UTILS.Byte(value, i - 1)
END;
c.length := 5
END;
LISTS.insertL(CodeList, label, c)
END pushImm;
 
 
BEGIN
n := UTILS.splitf(value, a, b);
pushImm(label, b);
pushImm(label, a)
END PushFlt;
 
 
PROCEDURE jcc* (cc, label: INTEGER);
VAR
j: JCC;
726,6 → 762,18
END pushm;
 
 
PROCEDURE LoadFltConst (value: REAL);
BEGIN
PushFlt(FltConstLabel, value);
INC(LocVarSize, 8);
IF FltConstLabel = mainFltConstLabel THEN
mainLocVarSize := LocVarSize
END;
OutByte2(0DDH, 045H + long(-LocVarSize)); (* fld qword[ebp - LocVarSize] *)
OutIntByte(-LocVarSize)
END LoadFltConst;
 
 
PROCEDURE translate (pic: BOOLEAN; stroffs: INTEGER);
VAR
cmd, next: COMMAND;
732,7 → 780,7
 
reg1, reg2, reg3, fr: INTEGER;
 
n, a, b, label, cc: INTEGER;
n, a, label, cc: INTEGER;
 
opcode, param1, param2: INTEGER;
 
862,7 → 910,10
pushc(0);
DEC(n)
END
END
END;
SetLabel(NewLabel());
FltConstLabel := CodeList.last(LABEL);
LocVarSize := param2 * 4
 
|IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
IF opcode = IL.opLEAVER THEN
881,7 → 932,7
 
ASSERT(fr = -1);
 
IF param1 > 0 THEN
IF LocVarSize > 0 THEN
mov(esp, ebp)
END;
 
891,7 → 942,9
OutByte(0C2H); OutWord(param2 * 4 MOD 65536) (* ret param2*4 *)
ELSE
ret
END
END;
FltConstLabel := mainFltConstLabel;
LocVarSize := mainLocVarSize
 
|IL.opPUSHC:
pushc(param2)
1941,11 → 1994,7
OutByte2(0D9H, 0E8H); (* fld1 *)
OutByte2(0D9H, 0E0H) (* fchs *)
ELSE
n := UTILS.splitf(float, a, b);
pushc(b);
pushc(a);
OutByte3(0DDH, 004H, 024H); (* fld qword[esp] *)
addrc(esp, 8)
LoadFltConst(float)
END
 
|IL.opSAVEF, IL.opSAVEFI:
2085,11 → 2134,9
IF fr > MAX_FR THEN
ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
END;
pushc(7FF00000H);
pushc(0);
OutByte3(0DDH, 004H, 024H); (* fld qword[esp] *)
addrc(esp, 8)
LoadFltConst(UTILS.inf)
 
 
|IL.opLADR_UNPK:
n := param2 * 4;
reg1 := GetAnyReg();
2227,7 → 2274,7
END translate;
 
 
PROCEDURE prolog (pic: BOOLEAN; target, stack, dllinit, dllret: INTEGER);
PROCEDURE prolog (pic: BOOLEAN; target, stack, dllret: INTEGER): INTEGER;
VAR
reg1, entry, L, dcount: INTEGER;
 
2236,9 → 2283,15
SetLabel(entry);
dcount := CHL.Length(IL.codes.data);
 
push(ebp);
mov(ebp, esp);
SetLabel(NewLabel());
mainFltConstLabel := CodeList.last(LABEL);
FltConstLabel := mainFltConstLabel;
mainLocVarSize := 0;
LocVarSize := 0;
 
IF target = TARGETS.Win32DLL THEN
push(ebp);
mov(ebp, esp);
pushm(ebp, 16);
pushm(ebp, 12);
pushm(ebp, 8);
2247,7 → 2300,6
jcc(je, dllret);
pushc(0)
ELSIF target = TARGETS.KolibriOSDLL THEN
SetLabel(dllinit);
OutByte(68H); (* push IMPORT *)
Reloc(BIN.IMPTAB, 0)
ELSIF target = TARGETS.KolibriOS THEN
2256,7 → 2308,9
push(reg1); (* push IMPORT *)
drop
ELSIF target = TARGETS.Linux32 THEN
push(esp)
mov(eax, ebp);
addrc(eax, 4);
push(eax)
ELSE
pushc(0)
END;
2297,6 → 2351,8
mov(esp, eax);
SetLabel(L)
END
 
RETURN entry
END prolog;
 
 
2341,8 → 2397,10
OutByte3(0C2H, 0CH, 0) (* ret 12 *)
ELSIF target = TARGETS.KolibriOSDLL THEN
movrc(eax, 1);
OutByte(0C9H); (* leave *)
ret
ELSIF target = TARGETS.Linux32SO THEN
OutByte(0C9H); (* leave *)
ret;
SetLabel(sofinit);
CallRTL(pic, IL._sofinit);
2400,7 → 2458,6
 
program := BIN.create(IL.codes.lcount);
 
dllinit := NewLabel();
dllret := NewLabel();
sofinit := NewLabel();
 
2414,7 → 2471,7
 
REG.Init(R, push, pop, mov, xchg, {eax, ecx, edx});
 
prolog(opt.pic, target, opt.stack, dllinit, dllret);
dllinit := prolog(opt.pic, target, opt.stack, dllret);
translate(opt.pic, tcount * 4);
epilog(opt.pic, outname, target, opt.stack, opt.version, dllinit, dllret, sofinit);