| ??? 04/05/03 20:07 Read: times |
#42956 - RE: how to swap the bit,,,urgent Responding to: ???'s previous message |
You can also do it by hooking two ports up in reverse. like p1.0 to p3.7, p1.1 to p3.6 and so on until p1.7 to p3.0. Then
mov p1,a mov a,p3 uhhh, well, it's more of a joke than it's meant to be a practical answer ;-) Michae's look-up table approach is probably the best. If you want to do it without a LUT, then mov c,acc.0 mov b.7,c mov c,acc.1 mov b.6,c mov c,acc.2 mov b.5,c mov c,acc.3 mov b.4,c mov c,acc.4 mov b.3,c mov c,acc.5 mov b.2,c mov c,acc.6 mov b.1,c mov c,acc.7 mov b.0,c mov a,b That's slower, but it takes less space in code memory. |



