I guess that FreePascal needs to be told to use Delphi ASM Style. Try including a $MODE-directive for Delphi-Mode. Then the ASM should do.

The second message is because of the APPTYPE-Directive that tells Delphi that a console program is to be written. Consult the docs of Freepascal of how to write console programs on Linux. IDK as I use neither FreePascal nor Linux.