delete old files

git-svn-id: svn://kolibrios.org@7694 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Anton Krotov 2019-09-26 20:32:03 +00:00
parent c4dee82cbc
commit fe240646ed
2 changed files with 0 additions and 1291 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,110 +0,0 @@
(*
BSD 2-Clause License
Copyright (c) 2018, 2019, Anton Krotov
All rights reserved.
*)
MODULE MACHINE;
IMPORT UTILS;
CONST
min32* = -2147483647-1;
max32* = 2147483647;
VAR
target*:
RECORD
bit_depth*,
maxInt*,
minInt*,
maxSet*,
maxHex*: INTEGER;
maxReal*: REAL
END;
_64to32*: BOOLEAN;
PROCEDURE SetBitDepth* (pBitDepth: INTEGER);
BEGIN
ASSERT(pBitDepth <= UTILS.bit_depth);
ASSERT((pBitDepth = 32) OR (pBitDepth = 64));
_64to32 := (UTILS.bit_depth = 64) & (pBitDepth = 32);
target.bit_depth := pBitDepth;
target.maxSet := pBitDepth - 1;
target.maxHex := pBitDepth DIV 4;
target.minInt := ASR(UTILS.minint, UTILS.bit_depth - pBitDepth);
target.maxInt := ASR(UTILS.maxint, UTILS.bit_depth - pBitDepth);
target.maxReal := 1.9;
PACK(target.maxReal, 1023);
END SetBitDepth;
PROCEDURE Byte* (n: INTEGER; idx: INTEGER): BYTE;
BEGIN
WHILE idx > 0 DO
n := ASR(n, 8);
DEC(idx)
END
RETURN ORD(BITS(n) * {0..7})
END Byte;
PROCEDURE Align* (VAR bytes: INTEGER; align: INTEGER): BOOLEAN;
VAR
res: BOOLEAN;
BEGIN
IF bytes MOD align # 0 THEN
res := UTILS.maxint - bytes >= align - (bytes MOD align);
IF res THEN
bytes := bytes + align - (bytes MOD align)
END
ELSE
res := TRUE
END
RETURN res
END Align;
PROCEDURE Int32To64* (value: INTEGER): INTEGER;
BEGIN
IF UTILS.bit_depth = 64 THEN
value := LSL(value, 16);
value := LSL(value, 16);
value := ASR(value, 16);
value := ASR(value, 16)
END
RETURN value
END Int32To64;
PROCEDURE Int64To32* (value: INTEGER): INTEGER;
BEGIN
IF UTILS.bit_depth = 64 THEN
value := LSL(value, 16);
value := LSL(value, 16);
value := LSR(value, 16);
value := LSR(value, 16)
END
RETURN value
END Int64To32;
END MACHINE.