Silverfrost Forums

Welcome to our forums

LS/RS-Documentation?

19 Feb 2021 11:34 #27116

Hello,

for porting reasons I would like to know the interface of functions LS and RS. Unfortunately I could not find these functions in topic

Library routines

of FTN95 Help System Overview, Run-time library (or elsewhere).

I would like to know all the types involved (for both the type to be shifted and the type of the shift amount).

I would appreciate any hint.

Regards, Dietmar

20 Feb 2021 12:15 #27128

This is from the FTN77 manual. It doesn't mention integer*8 but I am sure it will work with FTN95. :

LS, RS, LR and RR take two arguments; each argument may be either a long or a short integer. These arguments are called ARG1 and ARG2 in the following.

LS shifts ARG1 to the left by the number of bits specified in ARG2. The result has the type of ARG1, that is, no type change occurs. Vacated places are filled with zeros. If ARG2 is zero, no shift occurs. If ARG2 is negative, the effects of the operation are undefined.

RS is identical to LS, except that the shift is to the right.

LR rotates the bits in ARG1 by the number of bits specified in ARG2. The result has the type of ARG1, that is, no type change occurs. Bits are removed from the left hand end of ARG1 and replaced at the right hand end

Please login to reply.