PDA

View Full Version : Pipelining and other things..



breesy
- 10th May 2007, 12:25
Hey,

I've been using pbp pro for a while, however I have for the first time found a need to optimise code within a loop (software PWM) and in doing so have a few questions I was wondering if anyone knew the answer to:

1: In addition to the obvious performance penalty from having an interrupt check between PBP statements, would these interrupt branches cause a significant performance decrease by causing the pipeline to be cleared after every check? I believe the branches are followed by default, and given that these branches will be taken on very few checks, it seems like it would happen a lot (between almost every PBP statement). Is there a way to change the default behavior? Have I misunderstood pipelining?

2: Is there any difference between byte[50] and byte(50)?

3: Is there any way to have PBP output a nice assembly version of the code instead of going to binary? I've noticed the .asm file produced but it seems messy and its full of macros(?) rather than assembly statements.. I'm trying to convert the following statement to assembly, but it would be much easier if I could see the what the compiler comes up with: 'If Counter = dLEDX(1) Then dLED.1 = 0'

sayzer
- 10th May 2007, 12:46
.....it would be much easier if I could see the what the compiler comes up with: 'If Counter = dLEDX(1) Then dLED.1 = 0'

if you compile
If Counter = dLEDX[1] Then dLED.1 = 0
then you come up with something like



CMPNE?BBL _Counter, _dLEDX + 00001h, L00001
MOVE?CT 000h, _dLED??1
LABEL?L L00001


Was this the question?

mister_e
- 10th May 2007, 15:00
1. Polling interrupt flag will decrease the execution speed. The best efficient way will be to create an interrupt routine, ASM or with Darrel's instant interrupts.

2. not suppose to.

3.unfortunatley, PBP create a Macro based ASM, it's looking hard at first, but once you understand the Macro syntax, it's faster to read than real ASM. Let's see Sayzer snips.



CMPNE?BBL _Counter, _dLEDX + 00001h, L00001
MOVE?CT 000h, _dLED??1
LABEL?L L00001

CMPNE?BBL : Compare not equal a byte against a byte and branch to a label if result is false
It will compare Counter against dLEDX+1 (which is dLED[1]), it they are different, it will jump to label L00001

MOVE?CT : Move a Constant into a specific BIT
this will move 0 to dLED.1. Something like BCF

If you want a full assembler list, the only way is to import the .HEX fil in MPLAB and read the disassembly list, without label, without comments, without nothing.

mister_e
- 10th May 2007, 15:10
This one gave me the right kick in the but...
http://www.picbasic.co.uk/forum/showpost.php?p=2009&postcount=3

Thanks Darrel!

Acetronics2
- 10th May 2007, 15:16
If you want a full assembler list, the only way is to import the .HEX fil in MPLAB and read the disassembly list, without label, without comments, without nothing.

Hi, Steve ...

Too more beers once more ...

Starting from a PbP source and using MPLAB ... the Program Window ( w/right tab enabled ...!!! ) shows this nice ASM listing our friend would like to see !!!

With aliases, labels ans so on ... I can follow: that's a reference ( LOL ! )

But building the project from a PbP source is compulsory ...

Alain

mister_e
- 10th May 2007, 15:20
ah merde...

Acetronics2
- 10th May 2007, 15:23
Ou encore : Bout Filtre ...

Scuzi à tutte por l' à parte ...

Alain

mister_e
- 10th May 2007, 15:35
LMAO! And the RTFSoftware of the day goes to me ... WOOOHOOO!

You know i'm not a big MPLAB fan/user anyway? Case not, proofs are there :D

at least this feature was unknown...

ah pis mange... maudit francais ;) :D