Search found 3559 matches

by wilbert
Tue Oct 19, 2021 7:51 am
Forum: Tricks 'n' Tips
Topic: Memory List for Strings & Numbers
Replies: 6
Views: 229

Re: Memory List for Strings & Numbers

For small lists you could also use a structure union of a numeric type with a fixed length string. Structure PrefItem StructureUnion int.q str.s{64} EndStructureUnion EndStructure NewList PrefList.PrefItem() AddElement(PrefList()) PrefList()\int = 5 AddElement(PrefList()) PrefList()\str = "Hell...
by wilbert
Fri Oct 01, 2021 6:44 pm
Forum: Coding Questions
Topic: Did ASM syntax changed for PB 6.00 alfa?
Replies: 27
Views: 4475

Re: Did ASM syntax changed for PB 6.00 alfa?

Psychophanta wrote: Fri Oct 01, 2021 5:53 pmIt still does not work.
The only thing x64 brings to me is called PROBLEMS. :evil:
No improvement at all for the FPU, just problems. :evil:
The x64 name of the register is rdi instead of edi.
So you need to push rdi.
by wilbert
Mon Aug 30, 2021 7:15 pm
Forum: Coding Questions
Topic: Reading POINTs from an image, to draw on another.
Replies: 16
Views: 2037

Re: Reading POINTs from an image, to draw on another.

The use of Start and Stop drawing is very slow here, and I cannot see a way around it, without using an array or some other way of storing to memory. Is there any reason you don't want to use an array ? You can free the source image as soon as you have read all pixel colors into an array. That way ...
by wilbert
Wed Aug 18, 2021 12:12 pm
Forum: Coding Questions
Topic: attempting to convert some code
Replies: 8
Views: 474

Re: attempting to convert some code

You added a new point to the array but didn't change the dim statement to
Dim polygon.Point2D(4)
by wilbert
Wed Aug 18, 2021 11:43 am
Forum: Coding Questions
Topic: attempting to convert some code
Replies: 8
Views: 474

Re: attempting to convert some code

Something like this ? Structure Point2D x.d y.d EndStructure Procedure compute2DPolygonCentroid(Array vertices.Point2D(1), *centroid.Point2D) Protected.Point2D centroid, *prev, *next Protected.d signedArea, x0, y0, x1, y1, a Protected.i i, lastdex lastdex = ArraySize(vertices()) *prev = @vertices(la...
by wilbert
Sun Aug 08, 2021 2:23 pm
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1167

Re: Compare a number with list of numbers?

Otrebor wrote: Sun Aug 08, 2021 2:13 pmis this what you mean? Seems more simple than i thought... :oops:
Yes, that's both the easiest and fastest way. :)
by wilbert
Sun Aug 08, 2021 1:11 pm
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1167

Re: Compare a number with list of numbers?

What you describe is just a flag for every possible program counter address.
Using a 8 KiB bit array (65536 bits) with a set bit, clear bit and test bit procedure is all you need.
by wilbert
Sun Aug 08, 2021 8:13 am
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1167

Re: Compare a number with list of numbers?

I need to do this comparison as fast as possible. Since the elements in the list vary in quantity (even empty), i thought in NewList() and NewMap(). I don't know if the code you posted has anything to do with how you want to use it. If I look at the code you posted, it looks like you are using it a...
by wilbert
Tue Aug 03, 2021 4:35 pm
Forum: Coding Questions
Topic: Speed up processing a certain string
Replies: 15
Views: 1557

Re: Speed up processing a certain string

I tried ReadData, but it didn't speed up (at least not for me) ReadData is great when you are working directly on the loaded content with memory pointers. PB strings are not that fast when you have to process millions of strings. Right now, the best approach seems like RegEx or using a buffer and p...
by wilbert
Tue Aug 03, 2021 5:56 am
Forum: Coding Questions
Topic: Speed up processing a certain string
Replies: 15
Views: 1557

Re: Speed up processing a certain string

It's best to get the fields at the same time and not use StringField. If you would know for sure the fields never exceed a certain length like for example 20 characters, it can be made a lot faster. The code below could also be made a bit faster by using ASM if desired. DisableDebugger #MaxFields = ...
by wilbert
Wed Jul 28, 2021 5:58 am
Forum: Bugs - Windows
Topic: (Solved) short program dies on AllocateMemory (5.73 x64)
Replies: 3
Views: 2292

Re: short program dies on AllocateMemory (5.73 x64)

GPI is right.
You have to allocate room for one additional character.

Code: Select all

Define *mem=AllocateMemory(size + SizeOf(Character))
by wilbert
Mon Jul 26, 2021 1:40 pm
Forum: Coding Questions
Topic: [Solved ]Multiply String / Equivalent of Space for strings?
Replies: 28
Views: 3827

Re: [Solved ]Multiply String / Equivalent of Space for strings?

An alternative could be, to recycle the memory each time with the Static keyword. But then once a huge buffer is allocated, it will keep allocated until the program ends. Another alternative is to use a local array as a buffer. Procedure.s StringRepeat(String$, Count.i) Protected Dim Buffer.c(Len(S...
by wilbert
Thu Jun 03, 2021 2:02 pm
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 41030

Re: A small procedure asm

Thanks for the additional information. I'll try to code something capable of processing a 240 MB input and a max K of 31 with a focus on operating speed. Bigger K values like the 200 you mention require a different approach which makes it more difficult for me to optimize using asm and to support ca...
by wilbert
Thu Jun 03, 2021 8:34 am
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 41030

Re: A small procedure asm

Sooraa wrote: Wed Jun 02, 2021 6:22 pmThe download is selfexplanatory. The only thing you should do is to set the file content into all upper case and remove five textual separators
I did that but the file besides A,C,G and T also contains N. :?