[fpc-pascal] Function to set high and low Dword of a QWord

Florian Klaempfl florian at freepascal.org
Wed Feb 28 22:26:37 CET 2007


Jonas Maebe schrieb:
> 
> On 28 feb 2007, at 18:06, Florian Klaempfl wrote:
> 
>> Jonas Maebe schrieb:
>>>
>>> function makeqword(d1, d2: dword): qword;
>>> begin
>>>   result:=(qword(d2) shl 32) or d1;
>>> end;
>>
>> Cleaner imo:
>>
>> lo(result):=d1;
>> hi(result):=d2;
> 
> I think this is a lot less clean (if only because lo/hi have different
> meanings in FPC and Delphi, making it less clear what the code does).

Well, it should generate better code ;)

> Besides, lo()/hi() do not produce lvalues, so it doesn't even compile :)

Ops, I thought this worked :)



More information about the fpc-pascal mailing list