Menu
Recherche




Articles & Documents

Fermer Tutoriaux

Lettre d'information
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
22 Abonnés
CPDB.Net

Nouvelles des Amis
Visites

   visiteurs

   visiteurs en ligne

Webmaster - Infos
forum.gifForum - ppCompiler - Sujet n°55

Forum - Forum
ppCompiler - ppCompiler


actif  Sujet n° 55  TP Exit procs

le 03/12/2012 @ 13:42
par orlp

Anonyme



On my palm I used two short inline procedures written by Philippe to implement Turbo Pascal's exit and halt. Of course they use Motorola instructions.

Can you tell me the corresponding ARM instructions.

The Motorola versions are:

procedure exit; inline($4e5e,$4e75);
procedure halt; inline($2c6d,32,$4e5e,$4e75);

Alternatively I suppose I could use goto + label at the end of the procedure or program.



AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBulgarianCatalanChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDetect languageDutchEnglishEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRom anianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishThaiTurkishUkrainianUrduVietnameseWelshYiddish⇄AfrikaansAlbanianArabicArmenianAzerbaijani BasqueBelarusianBulgarianCatalanChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRom anianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishThaiTurkishUkrainianUrduVietnameseWelshYiddishEnglish (auto-detected) » English


Oliver Pretzel

Ecrire à orlp   Poster une réponse  Haut

[]   

Réponse n° 1
--------
le 03/12/2012 @ 13:51
par Philippe

Anonyme

visiteur
Of course, you can use a goto instruction, but the procedure halt that stops the program is predefined : procedure halt(output_code:integer);
Ecrire à Philippe   Poster une réponse  Haut
Réponse n° 2
--------
le 04/12/2012 @ 12:54
par orlp

Anonyme

visiteur
Thank you Philippe, I did not know that. For exit which terminates a procedure I would still need a goto, or I suppose I could define it as a function and use return.English (auto-detected) » English


Oliver Pretzel

Ecrire à orlp   Poster une réponse  Haut
Réponse n° 3
--------
le 04/12/2012 @ 19:21
par Philippe

Anonyme

visiteur
There is no easy way to define an "exit" procedure, even with inline assembler. I plan to add it in a future version. Waiting his time, you may try this :
procedure brol;
label 10;
    procedure exit;
    begin
      goto 10;
    end;
begin // of procedure brol
...

     exit; // anywhere
...

10:
end;

Philippe
Ecrire à Philippe   Poster une réponse  Haut
Réponse n° 4
--------
le 05/12/2012 @ 12:16
par orlp

Anonyme

visiteur
Yes, Philippe, that is what I thought of doing, but I think I'll just use the goto instruction directly at the exit point.


Oliver Pretzel

Ecrire à orlp   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 




^ Haut ^