Shop OBEX P1 Docs P2 Docs Learn Events
Simple PASM Question — Parallax Forums

Simple PASM Question

PropNewbiePropNewbie Posts: 10
edited 2009-09-12 02:57 in Propeller 1
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.

Comments

Sign In or Register to comment.