Reworked patch in rev. 28625 based on comments from Sergei

git-svn-id: http://svn.freepascal.org/svn/fpc/branches/mips_embedded@28634 3ad0048d-3df7-0310-abae-a5850022a9f2