Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: DLTimmons on March 20, 2013, 02:24:07 PM
-
I'm sure it is some place but I can not find a way to move bits into a word. The p-3000 has a pack and unpack function. I searched for any info on bit masking and could not find a thing in the help files.
I'm working on setting up a peerlink between 4 Do-Mores and using MOVER is waste of 15 bits per word.
Donnie
-
MOVER
Source: C0
Range: 10
Destination: V2000:0
Or
MOVE
Source: C0
Dest: V2000:4
-
There are many ways in Do-more to manipulate/pack/unpack bits in a word. Can you be more specific about what you are trying to do?
-
I would Like to take a group of C bits say C100 thru C115 move them to PL0 then that would be sent out the Peerlink to the other Do-Mores and there move them back to a group of c bit in that Do-More
-
I would Like to take a group of C bits say C100 thru C115 move them to PL0 then that would be sent out the Peerlink to the other Do-Mores and there move them back to a group of c bit in that Do-More
MOVER
C100
16
PL0:0
-
I would Like to take a group of C bits say C100 thru C115 move them to PL0 then that would be sent out the Peerlink to the other Do-Mores and there move them back to a group of c bit in that Do-More
MOVER
C100
16
PL0:0
Or easier still (and far faster execution-wise), word align them and just assign:
MOVE C96:W PL0
...or create nicknames for the specific bits and use them straight from PL memory:
MyFirstBit PL0:0
MySecondBit PL0:1
-
Thanks
Casting was what I need to find.
-
Or easier still (and far faster execution-wise), word align them and just assign:
MOVE C96:W PL0
...or create nicknames for the specific bits and use them straight from PL memory:
MyFirstBit PL0:0
MySecondBit PL0:1
What would the inverse of MOVE C96:W PL0 be?
-
I believe it's
MOVE PL0 C96:W
-
I believe it's
MOVE PL0 C96:W
Looks like it will be MOVE PL0 C96:SW If you use just a :W it puts a :SW in the instruction.
-
For bit transfers, use :UW (Unsigned Word) to ensure no sign extension on anything. So C96:UW is best.
-
Looks like it will be MOVE PL0 C96:SW If you use just a :W it puts a :SW in the instruction.
Sorry. When you apply a cast like that and don't provide a format type, it adds the default format for the type. As Franj said, use C96:UW...which aggregates 16 consecutive C bits unto a single unsigned word. As you have probably figured, the 'S' formats as signed integer.
-
Thanks
I knew there had to be a way.
-
Sorry. When you apply a cast like that and don't provide a format type, it adds the default format for the type. As Franj said, use C96:UW...which aggregates 16 consecutive C bits unto a single unsigned word. As you have probably figured, the 'S' formats as signed integer.
I noticed he asked about C100-C115, but you all are using C96 as your example. When doing a cast, must whichever is smaller, source or destination, begin on a word boundary? (Presumably it's automatic that the larger one will)
-
I noticed he asked about C100-C115, but you all are using C96 as your example. When doing a cast, must whichever is smaller, source or destination, begin on a word boundary? (Presumably it's automatic that the larger one will)
A cast isn't a source/destination thing, it is just a re-interpretation of the data at a location. The casting issue here is alignment, and related to how RISC style processors work. When you are doing an extraction cast (bigger to smaller), wrong answers aren't possible, but aggregation casts (smaller to larger) can result in mis-alignments that the processor architecture can't handle. So any time you are aggregating, the data must be aligned on the boundary of the cast size...bytes, words, or dwords. So C96 is a great choice because it is valid for bytes, words, or dwords...and was close to his specified range.
If he genuinely needed to move C100-C115, he could have used the MOVER instruction as plcnut suggested. The advantage of using an aggregation cast is that if the address is arbitrary, as in this case, it is much faster to do a simple MOVE. The MOVER with bits gives you great flexibility, but at the expense of performance. Always trade-offs...
-
A cast isn't a source/destination thing, it is just a re-interpretation of the data at a location. The casting issue here is alignment, and related to how RISC style processors work. When you are doing an extraction cast (bigger to smaller), wrong answers aren't possible, but aggregation casts (smaller to larger) can result in mis-alignments that the processor architecture can't handle. So any time you are aggregating, the data must be aligned on the boundary of the cast size...bytes, words, or dwords. So C96 is a great choice because it is valid for bytes, words, or dwords...and was close to his specified range.
Of course -- senior moment on my part! :D I was mixing thoughts about casting and MOVEing between different size source and destination and wanted to make sure that MOVER didn't need to be word-aligned. Thanks.
-
Of course -- senior moment on my part! :D
Dude...I understand that more and more all the time. More and more... ::)
-
BobO
What help me was finnaly finding the help page on casting. In the old gw basic you bit masked to get bit out of a Byte word or double word. It would have helped me to have a link in the help files that routed bit masking to the casting page.
All part of the learing curve, You still have a very powerful processor the more power the larger the learnming curve :)
Senior moment more like senior hour ::)
-
BobO
What help me was finnaly finding the help page on casting. In the old gw basic you bit masked to get bit out of a Byte word or double word. It would have helped me to have a link in the help files that routed bit masking to the casting page.
All part of the learing curve, You still have a very powerful processor the more power the larger the learnming curve :)
Senior moment more like senior hour ::)
Do-more is...um...extensive. ;) There really is a lot here. Often the issue isn't whether it can do something, it's which way is best to do it. Our hope is that the power users can do everything they want to, but that it's also comfortable for the folks who have more basic needs. I think it fits that, but I'm probably too close to it to be a good judge.