What new assembler instructions would you wish for?
Hi All;
I have been working·in Prop assembler (don't understand SPIN yet) for a while now, and am often in need of bit manipulation. While I like the instructions·that are available for that, there appear to be some inconvenient holes that require multiple instuctions to implement, and at 4 bytes per each, somewhat wasteful.
In particular, I miss or wish for:
-·loading a 32 bit immediate value
- testing an arbitrary bit in any cog location without using a mask
- setting or clearing an arbitray bit in any cog location without using a mask
- copying zero or carry (or their complements) to an arbitrary bit in any cog location without using a mask
- shifting through (as well as around) carry where carry holds its place in the sequence
There are of course many other wishes such as math operations, but I purposely restricted my set to·those bit manipulations I had actually needed, and I wondered if my requirements were unique, or if·others had similar experience.
If there is some consensus, then perhaps it is not too late for some to be included in the Prop2 instructiion set.
Cheers,
Peter (pjv)
I have been working·in Prop assembler (don't understand SPIN yet) for a while now, and am often in need of bit manipulation. While I like the instructions·that are available for that, there appear to be some inconvenient holes that require multiple instuctions to implement, and at 4 bytes per each, somewhat wasteful.
In particular, I miss or wish for:
-·loading a 32 bit immediate value
- testing an arbitrary bit in any cog location without using a mask
- setting or clearing an arbitray bit in any cog location without using a mask
- copying zero or carry (or their complements) to an arbitrary bit in any cog location without using a mask
- shifting through (as well as around) carry where carry holds its place in the sequence
There are of course many other wishes such as math operations, but I purposely restricted my set to·those bit manipulations I had actually needed, and I wondered if my requirements were unique, or if·others had similar experience.
If there is some consensus, then perhaps it is not too late for some to be included in the Prop2 instructiion set.
Cheers,
Peter (pjv)
Comments
allones long $ffffffff
declaration.
I agree about the other bit manipulations... it would be wonderful to have BIT{SET|CLEAR|TEST|TOGGLE} reg,{#}bitnum
perhaps WZ and WC could be used to mean write the bit to Z or C for the set/clear/toggle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
One instruction You may consider is Reversing BIT's on BYTE, WORD and LONG base.
REV dest, Byte 1 else 2 else 3 else 4
REV dest, word 1 else 2
REV dest, Long
Regards
ChJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
The shifting through the carry (having essentially a 33 bit shift) is one where a stronger case can be made. The only way to really implement it on Prop I is to do single bit RCL or RCR shifts. You can't do multiple shifts. Whether it's feasible depends on how the barrel shifter is implemented. There would need to be an additional group of terms. It may be too costly in terms of chip area.
I would like to see auto increment and decrement instructions, like DJNZ for HUB ops. Things like DWRLONG, WORD, BYTE, where the index is decremented, then a long is fetched from the HUB, that would permit an index to serve as a pointer, and not have to be both the pointer and loop counter, for a tight loop. Match that with IWRLONG, because flow control isn't a factor. Much better HUB utilization could occur in many cases, without so much effort being required to setup the loops.
I would second the bit, set, clear, test instructions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 11/7/2009 7:18:36 PM GMT
Yes, an immediate bit set/clear/test (1 long only per instruction) would be useful in some cases.
A WRBYTE etc... that could use INA as destination would be wonderful [noparse]:)[/noparse]
Post Edited (jazzed) : 11/7/2009 9:35:28 PM GMT
Many of my applications for a "without a mask" are to use the immediate capability within the instruction, hence a long is not required. So bit test/set/clear/toggle and C/Z copy could be directly effected in the destination with the bit position in immediate form in the instruction's source segment. Just like the current shift/rotates are done. I would have been able to save many longs if this instruction were available.
For generality of ccourse one would still expect the non-immediate mode, and the source to be able to select any cog address.
Cheers,
Peter (pjv)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
Cluso, I also remember discussion about that not being on the table in favor of some better instructions too. I think we don't know where Chip is at on this just yet. Maybe I'm remembering wrong...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
In any event, I'm sure the instruction set has been a done deal for quite some time now, so it's hardly worth offering suggestions at this point.
-Phil
Addendum: I do kinda remember something about an iterator or repeat instruciton, which would serve to augment a division step instruction. I'm not gonna comb through that thread to find it though!
Post Edited (Phil Pilgrim (PhiPi)) : 11/8/2009 3:12:15 AM GMT
I'd go for:
mul, mul, mul!, did I said mul already ?
div... with a step instruction like in the SuperH I'd be happy.
autoincrement/decrement definitely. I'd even go for base+index
byte transfer, any byte to any byte. That'd rock! like movs and movd but for bytes...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU