Post Reply 
(35S) Integer Bit Mirror
07-04-2015, 08:03 AM (This post was last modified: 06-15-2017 01:58 PM by Gene.)
Post: #1
(35S) Integer Bit Mirror
The programme takes an integer from the stack & returns the bit reversed integer.

eg For input

65

the programme returns

65

or for input

888

the programme returns

123.

Code:

1    LBL M
2    X=0?
3    RTN
4    0
5    x<>y
6    IDIV(REGX,2)
7    REGZ*2+RMDR(REGY,2)
8    x<>y
9    x≠0?
10    GTO M006
11    R↓
12    RTN
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)