Search found 303 matches

by Luis Babboni
Jan 18, 2017 19:59
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

I´m wrong or it saids that it is needed to do the same than you did with invByte for 8 bits byte now with 64 bits byte??!! :-(
by Luis Babboni
Jan 18, 2017 19:55
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Mmmmm, may be is not enough with this invByte for 8 bits bytes... :-( I´m afraid I need more help to understand if the following, that seems to be made in c++, is possible to be doing in FB. Note: all is from here: https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks...
by Luis Babboni
Jan 18, 2017 19:29
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

I like to misappropriate strings as byte arrays ... Well, behind the scenes, its exactly the same as a Byte-Array access. Execution time is equivalent if one does not compile with option -exx. I´m compiling my program with "Windows console " option saying below "fbc -s console" ...
by Luis Babboni
Jan 18, 2017 19:26
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Sorry guys, I do ot understand so much your discussion. I tried the suggestion from MrSwiss (the last post of page 1) and works nice..... but not know how to see how fast it really is. This about I3I2UI/I0 is faster? VDcampo, I think this is not what I want, I want to "flip" the byte horiz...
by Luis Babboni
Jan 18, 2017 11:55
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Thanks to all!!

I like grindstone suggestion!
I´ll comment as soon as I work on it! :-)
by Luis Babboni
Jan 18, 2017 1:32
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Luis Babboni wrote:...
for the opposite side I need to do (a´ Xor (a´ - 2*b´))´ being " ´ " the "swap" I talking.
...


Is the same like the other but "rotating the paper 180º".
by Luis Babboni
Jan 17, 2017 23:15
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Thanks fxm! But the target is to avoid loops. Try to use bits operators. for axample, for posible moves for the rook to left being the 8 occuped squares the 1s and 0s the free squares of the first byte and the 1 the position of the rook in the 2nd byte: a: 11000101 b: 00000100 This simple operation:...
by Luis Babboni
Jan 17, 2017 21:58
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Luis Babboni wrote:I think is this discussion!! :-)

http://freebasic.net/forum/viewtopic.php?t=4726


It seems at least in 2006 there was not a fast way to do it.
I need it in a critical part of my chess engine code so I need that it be as fast as possible.
by Luis Babboni
Jan 17, 2017 21:52
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

I think is this discussion!! :-)

http://freebasic.net/forum/viewtopic.php?t=4726
by Luis Babboni
Jan 17, 2017 21:47
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

Re: How to "reverse" a byte?

Tourist Trap wrote:The operator NOT maybe?


Mmm, Not 220 = 35 = 11000100 <> 11011100 = 59

My need is to transform a a byte where less important bit is the lefter in "the same byte" but where the less important bit be the righter.

In other way: 12345678 in 87654321
by Luis Babboni
Jan 17, 2017 21:34
Forum: Beginners
Topic: How to "reverse" a byte?
Replies: 69
Views: 5593

How to "reverse" a byte?

Hi people!

I want to know a fast way (if any) to go from for example:

00111011 to 11011100

in decimal (consider up numbers as UByte): from 220 to 59

Thanks!
by Luis Babboni
Nov 20, 2016 17:31
Forum: Projects
Topic: FB debugger : 2.96 32/64 BIT ..... (2020/02/17)
Replies: 647
Views: 165070

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

srvaldez wrote:this works

Code: Select all

Dim NPA As Double
Common Shared ttIndex As ULongInt

NPA=2277960380
ttIndex=NPA Mod 16777216LL 'uppercase L is easier to recognize

Print ttIndex

sleep


??!!
:-O

Thanks!
by Luis Babboni
Nov 20, 2016 17:16
Forum: Projects
Topic: FB debugger : 2.96 32/64 BIT ..... (2020/02/17)
Replies: 647
Views: 165070

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

May be my mistake is in other place.

This is the code that works in 64 bits but not in 32 bits:

Code: Select all

Dim NPA As Double
Dim ttIndex As ULongInt

NPA=2277960380
ttIndex=NPA Mod(16777216)

Print ttIndex

Sleep


Shows me
0 in 32 bits
13036220 as must be in 64 bits
by Luis Babboni
Nov 20, 2016 14:28
Forum: Projects
Topic: FB debugger : 2.96 32/64 BIT ..... (2020/02/17)
Replies: 647
Views: 165070

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

I need to start using FB 64 bits for my chess engine. At least seems that cause function mod() do not works if the argument is a longint number. I´m right? With 64 bits FB version works without problem. My problem now is that seems the 64 bits debugger needs to click manually in the update button to...
by Luis Babboni
Nov 16, 2016 18:19
Forum: Projects
Topic: FB debugger : 2.96 32/64 BIT ..... (2020/02/17)
Replies: 647
Views: 165070

Re: FB debugger : 2.91 32/64 BIT ..... (Aug 20th, 2016)

Thanks, now I understand. Works for me this way!!
Must be just some mistake then by my side in how to load values.

Go to advanced search