| ??? 05/01/02 14:36 Read: times |
#22363 - RE: passing port pin (to Mahmood) |
Shouldn't have pressed post so soon..
Here is how to do it, in unoptimized pseudocode. Bitset (byte sfrval, bit newval) { MOV A,sfrval; the 5 upper bits are the byte adr ANL A,#0F8 MOV R0,A MOV A,sfrval; the 3 lower bits are the "bit" ANL A,#07 MOV B,A ;... tired of writing assembly R2 = 2 ^ B if newval @R0 |= R2 else @R0 = @r0 & ~R2 ; done } |



