Recent

Author Topic: PicPas, Pascal compiler for Microchip PIC  (Read 114874 times)

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #30 on: May 07, 2017, 05:43:29 pm »
Mikro Pascal is a good compiler, although I have doubts about its optimization level. I have used it with the 16F series and works well. But it's not free. The evaluation copy is only for 2K of code.

And don't forget it's only for Windows, like Pic Micro Pascal. They have years announcing their Linux versions. 

PicPas is open source and multi-platform. I have compiled in Win32/Win64/Ubuntu64, I have not  a Mac to test.  If someone can compile it in Mac, I would be thankfull.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #31 on: May 08, 2017, 09:16:15 am »
I would ask, why Cannot  FPC compile to Microchip PIC?

Because nobody wrote a PIC backend (the part generating code for PIC) for it yet, I decided to go for Z80 first :)
Is everybody making a Z80 Pascal compiler? This is mine.  Working in the "wirth compiler" branch now.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #32 on: May 10, 2017, 04:34:52 pm »
Is everybody making a Z80 Pascal compiler? This is mine.  Working in the "wirth compiler" branch now.

I'm not doing a Z80 compiler, but if you take a long time, more and more Z80 compilers will be appearing.  :P
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #33 on: May 10, 2017, 04:51:56 pm »
I'm not doing a Z80 compiler, but if you take a long time, more and more Z80 compilers will be appearing.  :P

I thought one would need an infinite number of monkeys for that :P

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #34 on: May 10, 2017, 08:51:35 pm »
PicPas has been updated to the version 0.6.0  :D. All bit operation implemented, more optimization code included, tree syntax improved, parameters of procedures implemented, interfaz modified,  and many other features more.

Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #35 on: May 26, 2017, 05:07:30 pm »
hi
.
i download it from https://github.com/t-edson/PicPas
.
but :
1-the language of program is french(i thnik) can translate to englsh?(i think in older version,it was english)
.
2-when i open it ,error ?!?
.
3- when i extract it ,twice extract zip file?

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #36 on: May 26, 2017, 06:02:43 pm »
Hi.

PicPas is designed as multi-language (including the compiler messages), but by now, only English and Spanish implemented. The initial messages are in spanish, because the Config file is not yet loaded, so PicPas choose spanish  :-\.

No problem, I have changed it to English. Please update to the version 0.6.5.  There are some messages not translated, but it will be fixed in next versions.

If you have some problem in language, use the Config form.

Tell me if you find some other inconvenients, and thanks for test.

PD: If someone wish to include other languages for PicPas, let me know.  :D
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #37 on: May 26, 2017, 08:20:31 pm »
thank you :) :D ;D

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #38 on: May 26, 2017, 10:09:45 pm »
Hi Edson,
you have quiete a program here,
but have you ever tried i18n ?
http://wiki.lazarus.freepascal.org/Translations_/_i18n_/_localizations_for_programs
or at least put the Language specific code in separate (language specific folders) from where you include the parts for your prog.
This makes the handling and translating to other language much more easy.
If you like, I just do a German translation.
FormPrincipal line 570ff would be:
Code: Pascal  [Select][+][-]
  1.  'de': begin
  2.       //menú principal
  3.       mnFile.Caption:='&Datei';
  4.       mnEdit.Caption:='&Bearbeiten';
  5.       mnFind.Caption:='&Suchen';
  6.       mnView.Caption:='&Ansicht';
  7.       mnTools.Caption:='&Werkzeuge';
  8.  
  9.       acArcNuevo.Caption := '&Neu';
  10.       acArcNuevo.Hint := 'Neue Datei';
  11.       acArcAbrir.Caption := '&Öffnen...';
  12.       acArcAbrir.Hint := 'Datei öffnen';
  13.       acArcGuardar.Caption := '&Speichern';
  14.       acArcGuardar.Hint := 'Datei speichern';
  15.       acArcGuaCom.Caption := 'Speichern &unter ...';
  16.       acArcGuaCom.Hint := 'Datei mit unter neuem Namen speichern ...';
  17.       acArcSalir.Caption := '&Beenden';
  18.       acArcSalir.Hint := 'Programm beenden';
  19.  
  20.       acEdUndo.Caption := '&Zurück';
  21.       acEdUndo.Hint := 'Änderung zurücknehmen';
  22.       acEdRedo.Caption := '&Wiederholen';
  23.       acEdRedo.Hint := 'Änderung wiederholen';
  24.       acEdCut.Caption := 'A&usschneiden';
  25.       acEdCut.Hint := 'Ausschneiden';
  26.       acEdCopy.Caption := '&Kopieren';
  27.       acEdCopy.Hint := 'Kopieren';
  28.       acEdPaste.Caption := '&Einfügen';
  29.       acEdPaste.Hint := 'Einfügen';
  30.       acEdSelecAll.Caption := 'Alles &Auswählen';
  31.       acEdSelecAll.Hint := 'Alles auswählen';
  32.       acEdModCol.Caption := 'Block-Modus';
  33.       acEdModCol.Hint := 'Blockmode';
  34.  
  35.       acBusBuscar.Caption := 'Suchen...';
  36.       acBusBuscar.Hint := 'Text suchen';
  37.       acBusBusSig.Caption := 'Weitersuche&n';
  38.       acBusBusSig.Hint := 'Nächste Stelle suchen';
  39.       acBusReemp.Caption := '&Ersetzen...';
  40.       acBusReemp.Hint := 'Text ersetzen';
  41.  
  42.       acViewMsgPan.Caption:='&Nachrichten Panel';
  43.       acViewMsgPan.Hint:='Nachrichten Panel zeigen oder verbergen';
  44.       acViewStatbar.Caption:='&Statuszeile';
  45.       acViewStatbar.Hint:='Statuszeile zeigen oder verbergen';
  46.       acViewToolbar.Caption:='&Werkzeugleiste';
  47.       acViewToolbar.Hint:='Werkzeugleiste zeigen oder verbergen';
  48.  
  49.       acToolCompil.Caption:='&Compilieren';
  50.       acToolCompil.Hint:='Compiliere den Quelltext';
  51.       acToolComEjec.Caption:='Compilieren und Au&sführen';
  52.       acToolComEjec.Hint:='Compilieren und Ausführen';
  53.       acToolPICExpl.Caption:='PIC E&xplorer';
  54.       acToolPICExpl.Hint:='Öffne den PIC Geräte explorer';
  55.       acToolCodExp.Caption:='&Quelltext-Explorer';
  56.       acToolCodExp.Hint:='Öffne den Quelltext-Explorer';
  57.       acToolConfig.Caption := '&Einstellungen';
  58.       acToolConfig.Hint := 'Einstellungs-Dialog';
  59.     end;                                                  
  60.  
« Last Edit: May 26, 2017, 10:11:22 pm by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #39 on: May 26, 2017, 11:00:08 pm »
Hi Edson,
you have quiete a program here,
but have you ever tried i18n ?
http://wiki.lazarus.freepascal.org/Translations_/_i18n_/_localizations_for_programs
Hi, jc99. I have looked at that, a time ago, but I decided not to use. I don't remember why.  %)

Hi Edson,
or at least put the Language specific code in separate (language specific folders) from where you include the parts for your prog.
This makes the handling and translating to other language much more easy.
If you like, I just do a German translation.

Good. You have looked at an older version. The new version have the translation part at the root folder, in the files: tra_FormPrincipal.pas, tra_FormConfig.pas, ...

I would add more files later.

Please add the translation, to the last parameter of trans():

Code: Pascal  [Select][+][-]
  1.  
  2.   mnFile.Caption :=Trans('&File'  , '&Archivo', '','&Datei');
  3.  

Thanks.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

kupferstecher

  • Hero Member
  • *****
  • Posts: 583
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #40 on: May 26, 2017, 11:15:07 pm »
I18n is not difficult to use. And once its set up the changes are very fast. The translations can also be embedded in the program as resource to achive a standalone binary.

If you have questions, just ask~

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #41 on: May 27, 2017, 12:05:23 am »

Code: Pascal  [Select][+][-]
  1.  
  2.   mnFile.Caption :=Trans('&File'  , '&Archivo', '','&Datei');
  3.  

Thanks.
Exactly that's the problem with that code, (btw. I just checked out trunk, that should be the actual version.) Now you have all languages scattered in one, or lot of separate files,
The old version is not as good as i18n but you could do:
In FormPrincipal Lin 455ff you do:
Code: Pascal  [Select][+][-]
  1.  {$define FormPrincipal}
  2.  case lowerCase(lang) of        
  3.     {$I Espaniol.tra.inc};
  4.     {$I English.tra.inc};
  5.     {$I German.tra.inc};
  6.     {$I French.tra.inc} //!
  7.    else
  8.     {$define default}
  9.     {$I english.tra.inc}
  10.     {$undef default}
  11.   end;
  12.  

Language -Directory is part of include-Path
e.G English.tra.inc Look's partly like:
Code: Pascal  [Select][+][-]
  1. {$ifndef default}'en': {$endif}begin
  2.     {$ifdef FormPrincipal}
  3.           mnFile.Caption:='&File';
  4.           mnEdit.Caption:='&Edit';
  5.           mnFind.Caption:='&Search';
  6.           // ... rest ...
  7.     {$endif}
  8.     {$ifdef FrmCfgSynEdit}
  9.       Label6.Caption:='&Font:'; // How about lblFont.caption := ...
  10.       Label7.Caption:='&Size:'; // How about lblSize.caption := ...
  11.       Label8.Caption:='Back color:'; // How about lblBlackColor.caption := ...
  12.         // ... rest ...
  13.     {$endif}
  14.     {$ifdef FormCodeExplorer}
  15.       Caption:='Code Explorer';
  16.       mnRefresh.Caption:='&Refresh';  
  17.     {$endif}
  18. // ... other forms and definitions
  19.  end
  20.  
That way you have everything for one language in one file, and you can add as many languages as you like; 

You could even encapsulate the case-part in a separate Include, so you add new languages there and only once.
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #42 on: May 27, 2017, 04:17:16 am »

Code: Pascal  [Select][+][-]
  1.  
  2.   mnFile.Caption :=Trans('&File'  , '&Archivo', '','&Datei');
  3.  

Exactly that's the problem with that code, (btw. I just checked out trunk, that should be the actual version.) Now you have all languages scattered in one, or lot of separate files,

Well, that was the idea. To have all languages in one file, like a help for translation.

There is someone who is helping me on translation to the "quechua" language, and she doesn't speak english (and doesn't speak Pascal), and use the spanish translation like a guide.   :'(
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #43 on: June 01, 2017, 07:16:58 pm »
PicPas 0.6.6 is released  :D : https://github.com/t-edson/PicPas

Translation to english improved. New operations in the Code generator are implemented and support for complex expressions are improved. The  ASM blocks are now very completes, including jumps and access to variables.

The control structs are now implemented at the style of Modula-2:

Code: Pascal  [Select][+][-]
  1. IF <condition> THEN
  2.   <block of code>
  3. END;
  4.  
  5. IF <condition> THEN
  6.   <block of code>
  7. ELSE
  8.   <block of code>
  9. END;
  10.  
  11. IF <condition> THEN
  12.   <block of code>
  13. ELSIF <condition> THEN
  14.   <block of code>
  15. ELSE
  16.   <block of code>
  17. END;
  18.  
  19. WHILE <condition> DO
  20.   <block of code>
  21. END;
  22.  
  23. REPEAT
  24.   <block of code>
  25. UNTIL <condition>;
  26.  
  27. FOR  <variable> := <start-value> TO <end-value> DO
  28.   <block of code>
  29. END;
  30.  
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #44 on: June 01, 2017, 10:58:45 pm »
... and here comes a translation-patch

How about putting the tra*.pas files in a "language"-subdirectory ?

OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

 

TinyPortal © 2005-2018