Browse Subversion Repository
Contents of /branches/ttcomtester/tests/shift.ttl
Parent Directory
| Revision Log
Revision 10521 -
( show annotations)
( download)
Fri Jan 20 16:03:38 2023 UTC
(13 months, 2 weeks ago)
by zmatsuo
File size: 308 byte(s)
add communication test tool
| 1 |
num = $A5 ;10100101 |
| 2 |
cnt = 4 |
| 3 |
|
| 4 |
; left 8bit rotate shift |
| 5 |
rotleft = ((num << cnt) & $FF) + (((num << cnt) & $FF00) >> 8) |
| 6 |
|
| 7 |
sprintf '0x%X' rotleft |
| 8 |
messagebox inputstr '' |
| 9 |
|
| 10 |
|
| 11 |
; right 8bit rotate shift |
| 12 |
rotright = (num >> cnt) + ((num << (8 - cnt)) & $FF) |
| 13 |
|
| 14 |
sprintf '0x%X' rotright |
| 15 |
messagebox inputstr '' |
|