Latest versions
...
Menu  Language: fr
Search




Articles & Documents

Close Tutorials

Preferences

Connect again
---

Your name (or pseudo) :

Your secret code (associated with your pseudo)


 Count of members 426 members


Connected :

(nobody)
CPDB.Net

Friends News
Google Ads
Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
24 Subscribers
Webmaster - Infos
Visits

   visitors

   visitors online

Pagerank
forum.gifForum - ppCompiler [EN] - Topic #55

Forum - Forum
ppCompiler [EN] - ppCompiler [EN]


active  Topic # 55  TP Exit procs

03/12/2012 @ 13:42
by orlp

Anonymous



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

Write to orlp   Post an answer  Top

[]   

Answer n 1
--------
03/12/2012 @ 13:51
by Philippe

Anonymous


Of course, you can use a goto instruction, but the procedure halt that stops the program is predefined : procedure halt(output_code:integer);
Write to Philippe   Post an answer  Top
Answer n 2
--------
04/12/2012 @ 12:54
by orlp

Anonymous


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

Write to orlp   Post an answer  Top
Answer n 3
--------
04/12/2012 @ 19:21
by Philippe

Anonymous


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
Write to Philippe   Post an answer  Top
Answer n 4
--------
05/12/2012 @ 12:16
by orlp

Anonymous


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

Write to orlp   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 




^ Top ^