Recent

Author Topic: 1) Compiler output (assembler source) and 2) the "Until false;" statement/solved  (Read 576 times)

AlanTheBeast

  • Sr. Member
  • ****
  • Posts: 348
  • My software never cras....
1) Using the Ultibo configuration of Laz and I can't find a setting equivalent to the command line option:

      fpc -al myprog

which generates myprog.s assembler source.  How can that be done?

2) On the x86, if I code "Repeat" ... "Until false;" the compiler makes no compare, but puts in a JMP back to (just after) the Repeat statement.
(And thus sans optimization in the code or fpc command).

Code: Pascal  [Select][+][-]
  1.        Repeat   //Repeat not shown in .s file
  2. Lj199:
  3. # [479] x := random * 300;
  4.         ... etc. and
  5.         ... so on...
  6. # [483] UNTIL false;
  7.         jmp     Lj199
  8.  
  9.  

Is it so with the ARM compiler?

(True confession, I'm using Goto at present).
« Last Edit: August 22, 2022, 06:14:00 pm by AlanTheBeast »
Everyone talks about the weather but nobody does anything about it.
..Samuel Clemens.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5481
  • Compiler Developer
1) Using the Ultibo configuration of Laz and I can't find a setting equivalent to the command line option:

      fpc -al myprog

which generates myprog.s assembler source.  How can that be done?

Add -al to Project Settings -> Compiler Settings -> Custom Settings (or similar; I'm using the German version).

2) On the x86, if I code "Repeat" ... "Until false;" the compiler makes no compare, but puts in a JMP back to (just after) the Repeat statement.
(And thus sans optimization in the code or fpc command).

Code: Pascal  [Select][+][-]
  1.        Repeat   //Repeat not shown in .s file
  2. Lj199:
  3. # [479] x := random * 300;
  4.         ... etc. and
  5.         ... so on...
  6. # [483] UNTIL false;
  7.         jmp     Lj199
  8.  
  9.  

Is it so with the ARM compiler?

I'm not aware of any reason why it shouldn't do that, cause that is already done by the high level, platform independent part of the code generator.

AlanTheBeast

  • Sr. Member
  • ****
  • Posts: 348
  • My software never cras....
@PascalDragon ,

Thanks! With your help found it...

The option is (in the English v.):
 Project | Project Options | Compiler Options | Custom Options --- add "-al" in the text box.

The .s file for the program and units appears in the Lib/arm-ultibo folder in the project folder.

And confirming the JMP replaces "Until false;" under ARM:
Code: Pascal  [Select][+][-]
  1. # [655] Until false;
  2.         b       .Lj846
  3.  

Edit: clarified location where .s files are found
« Last Edit: August 22, 2022, 06:12:38 pm by AlanTheBeast »
Everyone talks about the weather but nobody does anything about it.
..Samuel Clemens.

 

TinyPortal © 2005-2018