mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 15:42:25 +00:00
ulmToInt16 now works -- noch
This commit is contained in:
parent
451bb287fe
commit
3e88d51eb6
1 changed files with 11 additions and 3 deletions
|
|
@ -60,12 +60,16 @@ MODULE ulmTypes;
|
||||||
Thus I leave it as LONGINT for now, before coming up with better solution -- noch *)
|
Thus I leave it as LONGINT for now, before coming up with better solution -- noch *)
|
||||||
UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*)
|
UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*)
|
||||||
UntracedAddressDesc* = RECORD[1] END;
|
UntracedAddressDesc* = RECORD[1] END;
|
||||||
|
|
||||||
|
intarr64 = ARRAY 8 OF SYS.BYTE; (* to emulate int16 on x86_64; -- noch *)
|
||||||
|
intarr16 = ARRAY 2 OF SYS.BYTE;
|
||||||
|
|
||||||
Count* = LONGINT;
|
Count* = LONGINT;
|
||||||
Size* = Count;
|
Size* = Count;
|
||||||
Byte* = SYS.BYTE;
|
Byte* = SYS.BYTE;
|
||||||
IntAddress* = LONGINT;
|
IntAddress* = LONGINT;
|
||||||
Int8* = SHORTINT;
|
Int8* = SHORTINT;
|
||||||
Int16* = INTEGER; (* we don't have 16 bit integer in x86_64 version of voc *)
|
Int16* = intarr16(*INTEGER*); (* we don't have 16 bit integer in x86_64 version of voc *)
|
||||||
Int32* = INTEGER;
|
Int32* = INTEGER;
|
||||||
Real32* = REAL;
|
Real32* = REAL;
|
||||||
Real64* = LONGREAL;
|
Real64* = LONGREAL;
|
||||||
|
|
@ -92,9 +96,13 @@ MODULE ulmTypes;
|
||||||
RETURN SHORT(SHORT(int))
|
RETURN SHORT(SHORT(int))
|
||||||
END ToInt8;
|
END ToInt8;
|
||||||
|
|
||||||
PROCEDURE ToInt16*(int: LONGINT) : Int16;
|
PROCEDURE ToInt16*(int: LONGINT; VAR int16: Int16)(* : Int16*);
|
||||||
|
VAR longintarr : intarr64;
|
||||||
BEGIN
|
BEGIN
|
||||||
RETURN SYS.VAL(Int16, int)
|
(*RETURN SYS.VAL(Int16, int)*)
|
||||||
|
longintarr := SYS.VAL(intarr64, int);
|
||||||
|
int16[0] := longintarr[0];
|
||||||
|
int16[1] := longintarr[1];
|
||||||
END ToInt16;
|
END ToInt16;
|
||||||
|
|
||||||
PROCEDURE ToInt32*(int: LONGINT) : Int32;
|
PROCEDURE ToInt32*(int: LONGINT) : Int32;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue