Min and max values of an array

Share your advanced PureBasic knowledge/code with the community.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Min and max values of an array

Post by mk-soft »

Doesn't work under c-backend anyway. It is written in ASM.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Min and max values of an array

Post by Lunasole »

tester wrote: Mon Mar 27, 2023 3:55 pm Not working with C-backend PB601 - Error: 'EndModule' is missing.
Maybe you missed that EndModule.

Still works

Code: Select all

Global Dim T1.l(300)
Define T
For T = 0 To 300
	T1(T) = Random(10000, 1)
Next

Define lMin, LMax
MinMax::MinMaxL(@T1(0), 301, @lMin, @LMax)

Debug lMin
Debug LMax
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Min and max values of an array

Post by Lunasole »

mk-soft wrote: Mon Mar 27, 2023 4:12 pm Doesn't work under c-backend anyway. It is written in ASM.
Why should not? I thought C-backend also supports ASM parts (and it should)
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Min and max values of an array

Post by mk-soft »

Lunasole wrote: Mon Mar 27, 2023 4:36 pm
mk-soft wrote: Mon Mar 27, 2023 4:12 pm Doesn't work under c-backend anyway. It is written in ASM.
Why should not? I thought C-backend also supports ASM parts (and it should)
Must be rewritten from ASM -> C-Backend ASM
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
tester
User
User
Posts: 30
Joined: Sun Dec 28, 2014 1:12 pm

Re: Min and max values of an array

Post by tester »

mk-soft wrote: Mon Mar 27, 2023 5:26 pm
Lunasole wrote: Mon Mar 27, 2023 4:36 pm
mk-soft wrote: Mon Mar 27, 2023 4:12 pm Doesn't work under c-backend anyway. It is written in ASM.
Why should not? I thought C-backend also supports ASM parts (and it should)
Must be rewritten from ASM -> C-Backend ASM
We are waiting for someone who can help with this. :)
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Min and max values of an array

Post by mk-soft »

But I don't think much of Intel-ASM inside C-backend, because it doesn't work with ARM processors.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Min and max values of an array

Post by Lunasole »

But I don't think much of Intel-ASM inside C-backend, because it doesn't work with ARM processors.
We are waiting for someone who can help with this. :)
So only ARM-asm is the question, while x86 still works as before.
Hah, yes that should be hard enough to find someone good in that.
There are no old farts who knew ARM ASM long ago, and a new farts just won't learn it because they writing code in some python or whatever :mrgreen:
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Min and max values of an array

Post by wilbert »

There are some vector extensions for gcc that maybe could be used
https://gcc.gnu.org/onlinedocs/gcc/Vect ... sions.html
but I don't know if those are also available on arm.
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Min and max values of an array

Post by Lunasole »

wilbert wrote: Wed Mar 29, 2023 10:46 am There are some vector extensions for gcc that maybe could be used
https://gcc.gnu.org/onlinedocs/gcc/Vect ... sions.html
but I don't know if those are also available on arm.
I won't say about this (I didn't dig at such levels for a long enough at all).
But glad to see you still here and doing something 8)
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Min and max values of an array

Post by wilbert »

Lunasole wrote: Wed Mar 29, 2023 11:16 pm I won't say about this (I didn't dig at such levels for a long enough at all).
But glad to see you still here and doing something 8)
Thanks :)
I do still visit the forum but haven't posted much lately.
A lot of my posts were related to asm or macOS.
Asm has become less relevant with the C backend and my mac doesn't receive updates anymore since a few years (but is still working fine for my own needs).
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply