Page 2 of 2

Re: Reverse a Number

PostPosted: Sat Jan 29, 2011 6:13 pm
by steve-myers
In Assembler we could do something like-
         MVC   RESULT,=AL1(2,1,0)
         TR    RESULT,SOURCE
...
RESULT   DC    CL3' '
SOURCE   DC    C'123'
I think the Cobol experts here could come up with something similar.

Re: Reverse a Number

PostPosted: Sat Jan 29, 2011 7:47 pm
by BillyBoyo
Agreed, but ecause the questioner did not clarify his parameters for the task, I "guessed between the lines" and made the assumption that the reverse would have to be done without defining additional storage.

I suppose in Assembler I can load the field into a register, and do a few bit shifts.