Page 1 of 1

[Implemented] new features

Posted: Sun Feb 09, 2003 6:46 pm
by BackupUser
Restored from previous forum. Originally posted by mdkrsta.

After my first days with PB I already found something what I'm missing (I used GFA-BASIC 32 before):

- I want to jump out from For..Next, Repeat..Until and While..Wend using an ExitIf command. Using Goto's is no good style.

- A logical NOT is missing.

- While..Wend is slower than For..Next and Repeat..Until. Why?

- a=a+1 should be faster than a=b+1 because it has one memory access less. Does this matter for the clock cycles of the Intel?

- The Debugger is not checking for array bounds. This would be useful to avoid illegal memory access errors.

- An automatic formatting of the source would be nice.

Anyhow, PB is an affordable and fast compiler for standard applications. Fred, keep up the good work. :)

Posted: Sun Feb 09, 2003 7:28 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

- I want to jump out from For..Next, Repeat..Until and While..Wend using an ExitIf command. Using Goto's is no good style.

Yes, it's planned (break)

- A logical NOT is missing.

Planned too (since a while, I know :)

- While..Wend is slower than For..Next and Repeat..Until. Why?

I should test that. Rememeber you can examine the asm output, to be fixed.

- a=a+1 should be faster than a=b+1 because it has one memory access less. Does this matter for the clock cycles of the Intel?

PB currently doesn't optimize such assignement. It's on my roadmap for v4.0.

- The Debugger is not checking for array bounds. This would be useful to avoid illegal memory access errors.

Done for the next version

- An automatic formatting of the source would be nice.

A plugin done by berikco is available

thanks for your inputs !

Fred - AlphaSND

Posted: Sun Feb 09, 2003 7:29 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

> I want to jump out from For..Next, Repeat..Until and While..Wend using an ExitIf command. Using Goto's is no good style.

I miss that one, too. (and a lot of other Users, too) Maybe it'll come someday.

> A logical NOT is missing.

Same here.

> While..Wend is slower than For..Next and Repeat..Until. Why?

I don't know, but While/Wend needs 1 more ASM instruction per Loop that Repeat/Until.
But For/Next needs 2 more, so this should be the slowest one.

I dont really know much about this, so it can also be a different reason. But they are all fast, aren't they :)

> a=a+1 should be faster than a=b+1 because it has one memory access less. Does this matter for the clock cycles of the Intel?

Mmmm, yes, it should be faster, but it produces exactly the same ASM output:

Code: Select all

; a=a+1
  MOV    ebx,dword [v_a]
  INC    ebx
  MOV    dword [v_a],ebx
; a=b+1
  MOV    ebx,dword [v_b]
  INC    ebx
  MOV    dword [v_a],ebx
@Fred: Couldn't this be more optimized? If I write(with InlineASM enabled):

INC a, 1

The Output is also

INC a, 1

Which is the same as a=a+1, or a+1, but is only 1 ASM instruction, not 3.

> The Debugger is not checking for array bounds. This would be useful to avoid illegal memory access errors.

Would be a nice new feature.

> An automatic formatting of the source would be nice.

Go here, for a tool by Berikco:
viewtopic.php?t=2320
(the Version near the end of the Topic is the newest one.)


You beat me by 33 Seconds, damn, I type to slow... :)


That's all...

Timo

Posted: Sun Feb 09, 2003 9:51 pm
by BackupUser
Restored from previous forum. Originally posted by mdkrsta.

INC a,1 will not work

should be ADD a,1

@Fred: Why can't we use ecx also in inline asm? You need it urgently?

Posted: Sun Feb 09, 2003 10:18 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

Ooops, my fault. I meant just meant INC a .
If you put ' ! ' in front of ASM code, it is compiled directly, without passing through the parser. So you can use whatever you want. But you must know, what you are doing.

Timo

Posted: Sun Feb 09, 2003 11:01 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi Fred,
when will we see v4.0 ???

greetz
MrVainSCL! aka Thorsten

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...

Posted: Sun Feb 09, 2003 11:31 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.

What does "a+1" as a single statement compile to?

Posted: Sun Feb 09, 2003 11:55 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

> What does "a+1" as a single statement compile to?

Same as "a=a+1"

It's in the Help. (Under 'Variables and Types', where the math operators are)

Timo

Posted: Mon Feb 10, 2003 8:22 am
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Originally posted by mdkrsta

After my first days with PB I already found something what I'm missing (I used GFA-BASIC 32 before):
Hi mdkrsta,

Welcome to Purebasic :)

I was GFA Basic 32 user and betatester before...
Believe me, GFA will quickly be just a bad memory :)

In GFA all 3 loop types are the same speed, because they all are converted to the same type of loop when compiling.
This is stated in the early GFA Betatester docs.
So loops that could be faster, where not optimized at all...shame..



Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm