Quote:

>Is there a way to create a type which defines a doubleword in tp7? I

>*really* need to have one, because the longint range is (of course) only

>half, and goes negative the same way, but I don't need the negative part.

>Can one replace the sign-bit or is the dword type definable.

Just disable the overflow checking and you can do addition, subtraction

and multiplication(*). For division where the dividend has high bit set

you need your own routines. Then of course you need to write routines

to translate to and from ASCII and comparisons.

(*) Signed and unsigned multiplications are identical as far as only the

lower 32 bits are considered. They do differ with the 32 bits that are

carried out but as those are not relevant in Pascal (beyond error

detection) one can use the signed multiplication for unsigned one.

Or if you have 386+ you could use following:

Function Dmul(x,y:longint):longint;

inline(

$66/$5B/ {POP EBX}

$66/$58/ {POP EAX}

$66/$F7/$E3/ {MUL EBX}

$66/$0F/$A4/$C2/$10 {SHLD EDX,EAX,10h}

);

Function DDiv(x,y:longint):longint;

inline(

$66/$5B/ {POP EBX}

$66/$58/ {POP EAX}

$66/$31/$D2/ {XOR EDX,EDX}

$66/$F7/$F3/ {DIV EBX}

$66/$0F/$A4/$C2/$10 {SHLD EDX,EAX,10h}

);

For comparison you could XOR the both parts with $8000000, that is

instead of if x<y then ... write if x xor $80000000 < y xor $80000000

then ... (of course you could define a constant for that value). You

could also subtract the above value from both. I have not tested that.

If you need to test only equality then there is no need for such

tricks.

Osmo