Shop OBEX P1 Docs P2 Docs Learn Events
I need to do logical operations on 64-byte and 128-byte variables — Parallax Forums

I need to do logical operations on 64-byte and 128-byte variables

youngdaveyoungdave Posts: 70
edited 2009-09-03 15:08 in Propeller 1
Dear All
I need to do logical operations on 64-byte and 128-byte variables, but Spin doesn't support them.
Can I do the following all in a flash, without using a loop?
array0[noparse][[/noparse]n to m] AND array1[noparse][[/noparse]n to m]
TIA David Young

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-09-03 08:41
    no you will need to write a loop to do it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-09-03 12:28
    > Can I do the following all in a flash, without using a loop?

    By unrolling the loop?

    array0[noparse][[/noparse]m] AND array1[noparse][[/noparse]m]
    array0[noparse][[/noparse]n] AND array1[noparse][[/noparse]n]
    ...
    array0[noparse][[/noparse]x] AND array1[noparse][[/noparse]x]

    Was that serious enough? wink.gif


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • he1957he1957 Posts: 58
    edited 2009-09-03 13:58
    Hello youngdave,

    Please describe exactly:

    1. what it is you want to do
    2. why you want to do it and
    3. what you have tried to accomplish this

    Post your code so it can be examined.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-03 15:08
    Dave,

    I'd write methods for things like crossover and mutation. You do need to use a loop for multi-long logic operations, either with a repeat or unrolled, but at least with a method, you only have to write it once. For single-point crossover, of course, the boolean operation has to be performed only on a single long. The remaining longs can just be swapped or copied.

    -Phil
Sign In or Register to comment.