Skip to content

Commit

Permalink
p0011 Вынос констант в отдельный модуль. АХТУНГ!! Изменились параметр…
Browse files Browse the repository at this point in the history
…ы командной строки!!
  • Loading branch information
svi committed Dec 22, 2018
1 parent df8e3f0 commit f9c28a4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
Binary file modified Compiler32.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions self32.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Compiler32.exe source\Compiler.ob07 source\Compiler32.exe con -stk 1 -pic
Compiler32.exe source\Compiler.ob07 source\Compiler32.exe console -stk 1 -pic
REN Compiler32.exe Compiler32old.exe
MOVE source\Compiler32.exe Compiler32.exe
Compiler32.exe source\Compiler.ob07 source\Compiler32.asm con -stk 1 -pic
Compiler32.exe source\Compiler.ob07 source\Compiler32.asm console -stk 1 -pic
@pause
35 changes: 18 additions & 17 deletions source/Compiler.ob07
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,29 @@ IMPORT mSt := STATEMENTS,
mWrit := WRITER,
mConst:= modConstante;


PROCEDURE Target_Get (s: ARRAY OF CHAR): INTEGER;
PROCEDURE Target_Get (pTarget: ARRAY OF CHAR): INTEGER;
(* Compare pTarget (platform) white string constante.
Return associate integer constante. *)
VAR
res: INTEGER;
iRes: INTEGER;
BEGIN
IF s = "con" THEN
res := mTarg.CONSOLE
ELSIF s = "gui" THEN
res := mTarg.GUI
ELSIF s = "dll" THEN
res := mTarg.DLL
ELSIF s = "kos" THEN
res := mTarg.KOS
ELSIF s = "obj" THEN
res := mTarg.OBJ
ELSIF s = "win64" THEN
res := mTarg.WIN64
IF pTarget = mConst.TARGET_CONSOLE THEN
iRes := mTarg.CONSOLE
ELSIF pTarget = mConst.TARGET_GUI THEN
iRes := mTarg.GUI
ELSIF pTarget = mConst.TARGET_DLL THEN
iRes := mTarg.DLL
ELSIF pTarget = mConst.TARGET_KOLIBRY THEN
iRes := mTarg.KOS
ELSIF pTarget = "obj" THEN
iRes := mTarg.OBJ
ELSIF pTarget = "win64" THEN
iRes := mTarg.WIN64
ELSE
res := 0
iRes := 0
END

RETURN res
RETURN iRes
END Target_Get;

PROCEDURE keys (VAR StackSize, BaseAddress, Version: INTEGER; VAR pic, reloc: BOOLEAN; VAR checking: SET);
Expand Down
6 changes: 5 additions & 1 deletion source/modConstante.ob07
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ MODULE modConstante;
*)

CONST
FILE_EXT* = ".ob07";
FILE_EXT* = ".ob07";
TARGET_CONSOLE* = "console";
TARGET_GUI* = "gui";
TARGET_DLL* = "dll";
TARGET_KOLIBRY* = "kos";

END modConstante.

0 comments on commit f9c28a4

Please sign in to comment.