| ??? 06/01/03 18:02 Read: times |
#47183 - RE: Grabbing a bit from a byte? Responding to: ???'s previous message |
the following below was produced by the RC51 COMPILER from the source you provided. mychar = 0xFF; mymask = 0x02; //I want to get bit 1 mybit = mychar & mymask; converts to..
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION main (BEGIN)
; SOURCE LINE # 20
0000 7500FF R MOV mychar,#0FFH
; SOURCE LINE # 21
0003 750002 R MOV mymask,#002H
; SOURCE LINE # 22
0006 E500 R MOV A,mymask
0008 5500 R ANL A,mychar
000A 24FF ADD A,#0FFH
000C 9200 R MOV mybit,C
Is this not tight enough.. |
| Topic | Author | Date |
| Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 |



