Shop OBEX P1 Docs P2 Docs Learn Events
test code command — Parallax Forums

test code command

mynet43mynet43 Posts: 644
edited 2007-05-14 16:28 in General Discussion
shift                   mov     t1, #5                  ' init t1 to 5
                        shl     t1, #16                 ' shift left 16 bits
                        mov     t3, #0                  ' shift count + 1
                        
:rolagain               add     t3, #1                  ' count the shifts
                        rol     t1, #1          wc
              if_nc     jmp     :rolagain

                        ror     t1, #1                   ' shift the high bit back in
shift_ret               ret

Sign In or Register to comment.