The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

Archive for the ‘Delphi’ Category

More on Delphi x64 by twitter kylix_rd (Allen Bauer)

Posted by jpluimers on 2010/11/09

As a continuation of the previous assembly, the new twitter kylix_rd messages on Delphi x64 (and some reactions by Danny Thorpe):

To save people from browsing Twitter history:

kylix_rd:

Interesting x64 fun fact: RIP relative addressing. Some instructions that use a 32bit offset, are interpreted as [RIP+offs].
7 nov

@danny_thorpe Add x64 and it happens even more.
7 nov

Because of the way the Intel instructions are encoded, it is possible to encode the same effective instruction in different ways.
7 nov

You know what would have made the x64 “REX” prefix moniker even better? They could have called it T-REX.
7 nov

As much as people like to deride the aging x86 architecture, I gotta admit that AMD did a fine job of stretching it into 64bit land.
7 nov

@davidheff Undetermined. There are plenty of reasons to deliver them separately. Either way will have no impact on the results.
2 Nov

Be ready for 64 bit: In Delphi XE, this “Component.Tag := NativeInt(Self);” will just recompile in 64 bit.
2 Nov

@davidheff Oh don’t worry… there will be plenty who will find that “limiting”, if only in concept and not in the real world :-)
2 Nov

x64 Fun Fact: JMP opcodes/offsets are identical to 32bit. Can only xfer control to an address +/- 2GB away. Thus the PE image size limit.
2 Nov

danny_thorpe:

@kylix_rd I remember digging through the x64 specs. Fun times til mgmt shut it down. Still have my Amd x64 laptop circa 2003 or so.
8 nov

@kylix_rd You just noticed? :P
8 nov

davidheff:

@kylix_rd is it still on course to be a cross-compiler as announced by Nick – single 32 bit compiler that can create 32 and 64 bit images
from Stavanger, Rogaland
2 Nov Favorite Retweet Reply

@kylix_rd Actually, I wonder whether the compiler wouldn’t give out first at such a monstrous demand
from Stavanger, Rogaland
2 Nov

@kylix_rd Think most of us should be able to avoid creating 2GB images!!!!
from Stavanger, Rogaland
2 Nov

–jeroen

via Allen Bauer (kylix_rd) on Twitter
Danny Thorpe (danny_thorpe) on Twitter
David Heffernan (davidheff) on Twitter

Posted in Delphi, Development, kylix_rd, SocialMedia, Software Development, Twitter | 5 Comments »

Delphi refactoring bugs – need input

Posted by jpluimers on 2010/11/04

One of the reasons that people are wary of using Delphi refactorings, is that some of them are not always reliable.

The only way to get them resolved is filing good bug reports.
But filing a good bug report is difficult: you need reproducible cases, and finding those can be tough.

Some of the refactorings can only be done by tools that have access to the complete compiler.
Which means that 3rd party tools like Model Maker Code Explorer, Castalia, cnPack and others cannot provide.

So I need some help in filing bugs centered around the refactoring topic:

  • Indicate weak points of the various refactorings
  • Help finding reproducible steps

Here are a few examples I filed recently:

  1. [WayBack] “No statements are selected” when performing “Extract Method” refactoring from case statement
  2. [WayBack] Complete case statement extracted when performing “Extract Method” refactoring from case statement
  3. [WayBack] Refactoring “Find Unit” often does not work any more

Please put your suggestions in the comments!

–jeroen

Some notes:

  1. Set Delphi “Block Indent” to 3
  2. Refactor – Extract method: it uses a Block Indent of 2.

Posted in Delphi, Development, QC, Software Development | 6 Comments »

Some ASX information in order to create a partical XSD schema of it

Posted by jpluimers on 2010/11/03

I tried searching for an XSD or other schema that describes ASX (Advanced Stream Redirector) files, but somehow could not find them.

The ASX files can be used to generate a playlist, but they are a bit richer in content than the WPL (Windows Media Player Playlist) file format.

So here is a post with some references to ASX files, examples, documentation and an XSD you could use for ASX files, and why ASX is not valid XML, it is just well-formed. Read the rest of this entry »

Posted in .NET, C#, Delphi, Development, Software Development, XML, XML/XSD, XSD | 2 Comments »

Interesting Delphi questions on StackOverflow by Ian Boyd in constructors, methods and directives.

Posted by jpluimers on 2010/11/02

Last month, Ian Boyd posted a series of interesting questions on StackOverflow.

They all handle specific situations on methods (especially constructors), classes and directives.

He used them to get a more detailed picture of how that all fits together.

Interesting reading!

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

More Delphi x64 bits – Allen Bauer (kylix_rd) on Twitter

Posted by jpluimers on 2010/11/01

To save people from browsing Twitter history:

danny_thorpe:

@davidheff @kylix_rd x64 has SSE2 for FP ops. 8 directly addressable 64bit XMM FP registers. 8087 FP ops emulated in microcode, deprecated

28 Oct

@kylix_rd You mean critical mass isn’t church service on Christmas and Easter?

27 Oct

@kylix_rd Bah. What do they know about floating point? :P MSVC turns off all the FP hardware (exceptions) by default already!

27 Oct

@kylix_rd Yes, we did. The reason was Extendeds don’t exist at all in CLR. x64 FP ops only supporting 64 bit floats is justification

27 Oct

@kylix_rd Ok, so your cause/effect statement was incomplete. :P Shame to see extendeds go. How to count all atoms in the universe now?

27 Oct

@kylix_rd That doesn’t follow. You could still pass extendeds on the stack (not using the x87 register stack)

27 Oct

kylix_rd:

@davidheff Yes. Alignment is critical. Even the stack must remain properly aligned. Its all part of the ABI.

27 Oct

@davidheff SSE instructions and the xmm0:xmm15 registers.

27 Oct

@danny_thorpe That and the fact that MS strongly discourages the use of the FP coproc on 64 bit Windows.

27 Oct

@danny_thorpe Extendeds don’t align well, FP ops would dumb them down, sub-optimal codegen, are other reasons to drop them.

27 Oct

http://goo.gl/D0Kv. “The x87 register stack is unused. … must be considered volatile across function calls” So, Extended = Double.

27 Oct

As speculated, the Tag property will become a NativeInt.

27 Oct

@malcolmgroves @seanbdurkin And if we change the underlying implementation, don’t complain… mkay?

27 Oct

The elephants in the room. Max 64bit PE image size 4GB. Extended = Double (since xmm0-xmm4 are for FP param passing).

27 Oct

Number of calling conventions in x64 – 1. pascal, register, cdecl, stdcall… gone, treated as nop.

26 Oct

Wow… just a few tweets about D64 and I get flooded with new followers. Welcome to all my new followers from the last 24 hours.

26 Oct

Most common 64bit data models, LP64 and LLP64. Windows = LLP64, Linux, OSX = LP64. D64/Windows = LLP64.

26 Oct

64bit gotcha: SizeOf(THandle/HWND/HMODULE/Hxxxx) = SizeOf(Pointer) = 8. This isn’t valid: Value := Integer(Handle).

26 Oct

Type sizes for 64: SizeOf(Integer)=4, SizeOf(NativeInt)=SizeOf(Pointer)=8,

26 Oct

If you must… Value := Integer(TList[x]) -> Value := NativeInt(TList[x]). Even better, TList.

26 Oct

via Allen Bauer (kylix_rd) on Twitter
Danny Thorpe (danny_thorpe) on Twitter

Posted in 8087, Algorithms, Delphi, Development, Floating point handling, kylix_rd, SocialMedia, Software Development, Twitter | Leave a Comment »

Delphi Basics – worth a look!

Posted by jpluimers on 2010/10/27

Quite a while ago, Neil Moffat started the Delphi Basics site.

It is aimed at beginners, but since it has such a wealth of information (for instance a comprehensive list of compiler directives).
So even if you are a Delphi pro, it is worth to give Delphi Basics a look.

The cool thing: Neil originally is not even a programmer, nor a writer.
Maybe that is his strength: he learned by doing, step by step, now giving us a peak on what he learned.

–jeroen

via Delphi Basics.

Posted in Delphi, Development, Software Development | 8 Comments »

Signs of Delphi x64: Allen Bauer (kylix_rd) on Twitter

Posted by jpluimers on 2010/10/26

Probably a few others will blog about these tweets too.
I have bolded the most important pieces:

kylix_rd Allen Bauer

If you must… Value := Integer(TList[x]) -> Value := NativeInt(TList[x]). Even better, TList<Integer>.

6 hours ago

kylix_rd Allen Bauer

Another Milestone: fixed my first legitimate 64bit RTL bug. if TryOpenForInput(t) then s/b if not TryOpenForInput(t) then

10 hours ago

kylix_rd Allen Bauer

Milestone: 64bit compiler now merged into the main dev branch! All devs are now locked and loaded!

13 hours ago

–jeroen

via Allen Bauer (kylix_rd) on Twitter.

Posted in Delphi, Development, kylix_rd, Software Development | Leave a Comment »

Twitter / Danny Thorpe: New programmers are drawn …

Posted by jpluimers on 2010/10/21

Brilliant and so true:

New programmers are drawn to multithreading like moths to flame, with similar results.

Edit: And this is just one example on how tiny little details can impact threading so much.

–jeroen

via Twitter / Danny Thorpe: New programmers are drawn ….

Posted in .NET, Agile, CommandLine, Debugging, Delphi, Development, Opinions, Software Development | 10 Comments »

Solution for OLE DB provider connecting to SQL Server giving error “Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done”

Posted by jpluimers on 2010/10/19

Recently, I had the error message “Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done” occur to me when connecting through the “Microsoft OLE DB Provider for SQL Server”.

I got the below message (in this case in Delphi, but I have seen lots of other people having the same issue using other environments too): Read the rest of this entry »

Posted in Database Development, Delphi, Development, Software Development, SQL Server | 5 Comments »

co-worker question: what is better, extension methods or helper classes?

Posted by jpluimers on 2010/09/29

Recently, a co-worker at a client asked me “What is better: extension methods of helper classses?”.

This question is relevant not only in the .NET and Delphi worlds.

My answer was simple, consisting of these 3 points: Read the rest of this entry »

Posted in .NET, C#, C# 4.0, Delphi, Development, Opinions, Software Development | 5 Comments »