Simple PASM Question
PropNewbie
Posts: 10
Sorry for the simple question but what is the best way to force an arbitrary bit low in a long in PASM
For example if I wanted to toggle the·third bit I would XOR with·0100
mov t1,#1
shl·· t1,#2
xor· target,t1
So how would I set the third·bit low? What I want to do is
mov t1,#1
shl·· t1,#2
not··t1
and· target,t1
but I cannot seem to find a logical·NOT in the PASM command set. Is there a better way - perhaps some trick I don't know about? Can I get a logical NOT somehow? Is that what the NEG commands are for? My understanding is that NEG is just for signed integers.
All advice much appreciated.
For example if I wanted to toggle the·third bit I would XOR with·0100
mov t1,#1
shl·· t1,#2
xor· target,t1
So how would I set the third·bit low? What I want to do is
mov t1,#1
shl·· t1,#2
not··t1
and· target,t1
but I cannot seem to find a logical·NOT in the PASM command set. Is there a better way - perhaps some trick I don't know about? Can I get a logical NOT somehow? Is that what the NEG commands are for? My understanding is that NEG is just for signed integers.
All advice much appreciated.
Comments
-Phil
Thank you.
Not that I need it now, ANDN will do the job nicely, but it seems the sort of thing I ought to know how to do.
Thanks...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
On edit -- Jazzed beat me to it :-(
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (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