ccSHL
ccSHR

Syntax

Uint64 = ccSHR(Target:Uint64,OPT CandC = 32:Word/or Word ByRef)
Uint64 = ccSHL(Target:Uint64,OPT CandC = 32:Word/or Word ByRef)

Description

Shift Logical Right or
Shift Logical Left on 64 bits Variable.

.--.           .------------------.           .--.
|C |------>|63 ----------> 0 |------>|C|
._.           '------------------'           '--'
.--.            .------------------.           .--.
|C |<------|63 ----------> 0 |<------|C |
._.            '------------------'           '--'

CandC = CandC|Carry << 9

Parameters

Target - Variable which bits will be shifted.
CandC - Counter for the bits being shifted. And in it's 8-th bit the Carry shifted in.

Return value

A Uint64 Shifted
'CandC' will contain 'CandC' and in it's 8-th bit the value of the last bit shifted out

Remarks

Sample:
By bit 8 = 1 of 'CandC' ccSHL("....00001",2) will result "....00111"
ccSHR("1000....",2) = > "1110....."

To get the Carry use Carry = CandC >> 8
And you have to give the 'CandC' Byref!!!
Like :
R = ccSHR(R,&CandC)


The standard value for 'CandC' is 32 to easily get the low/high part of a UInt64.

Example usage

R = ccSHL(R,S)
R = ccSHR(R,3)

See
Logics_Demo.eba