8051 Programme to store the higher nibble of r7 in to both nibbles of r6

By


Statement : - store the higher nibble of r7 in to both nibbles of r6
Solution: –first we shall get the upper nibble of r7 in r6. Then we swap nibbles of r7 and make OR operation with r6 so the upper and lower nibbles are duplicated       



      
Mov a, r7                     ; get the content in acc
                        Anl a, #0F0h                ; mask lower bit
                        Mov r6, a                     ; send it to r6
                        Swap a             ; xchange upper and lower nibbles of acc
                        Orl a, r6                       ; OR operation
                        Mov r6, a                     ; finally load content in r6



0 comments:

Post a Comment

If you have any questions or droughts feel free to ask here.