Showing posts with label FreePascal. Show all posts
Showing posts with label FreePascal. Show all posts

Dec 13, 2016

ConTEXT - a lightweight editor for developer Delphi and FreePascal

ConText is a freeware text editor (on Windows) written in Delphi (compiled with using Borland Delphi). Go to the home page here
See the following configuration:

Using ConTEXT as text editor and FreePascal as compiler we have a cool "IDE"! :D
We configured compiling source code by F9 and executing by F10. I wrote a related blog here (in Vietnamese).

Oct 30, 2016

Using return statement in Pascal such as C language

C/C++ language allow us to retrieve the values of functions by using return keyword. See the following example:

int func () {
    return {values-here};
}
Objects Pascal (such as Free Pascal, Virtual Pascal) using variable result to retrieve the values of function. By using {$X+} directive:

{$X+}
function func: integer;
begin
    result:= {values-here};
end;
Return statement isn't a good coding practice. Using return statement could cause multiple ret instruction to be issued and it causes bigger code.

Oct 29, 2016

How to create portable FreePascal on Windows

FreePascal (FPC) is an advanced open source compiler for Pascal/Objects Pascal and Delphi. In order to create portable FPC on Windows we need some files such as:
  1. cigwin1.dll
  2. fp.exe
  3. fpc.exe
  4. fpinstres.o
  5. fpinstres.ppu
  6. ppc386.exe
  7. sysinitpas.o
  8. sysinitpas.ppu
  9. system.o
  10. system.ppu
And the total size of packed portable freepascal is 2.8 MB at least.