BIT. - Work with Bits

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > BIT. - Work with Bits >

BIT. - Work with Bits

BIT.16to32 - concatenate 2 Words to 32 Bit DWord

Previous Top Next


MiniRobotLanguage (MRL)

 

BIT.16to32

concatenate 2 Words to 32 Bit DWord

 

 

Intention

 

Concatenate two 16-Bit variables into One 32-Bit Variable.

 

The parameters P1 and P2 can be given as value or as "binary".

The result is a 32-bit variable.

 

You can define for all 3 Parameters if they should be in "Value" or "Binary Format. For Details on these Parameter-Formats see

! Smart Package Robot 's BIT. - Operations

 

 

' Using a value Number as Input

VAN.$$LEA=4

VAN.$$P01=&B1111111111111111

VAN.$$P02=&B1010101010101010

BIT.16to32|v$$P01|v$$P02|v$$ERG

BIT.Show|v$$ERG|$$ERG|$$LEA

NVS.$$ERG=10101010101010101111111111111111

  GTO.ero

EIF.

:ero

 

Bit01

This picture shows the result of the Script.

 

 

' Having a Binary result, using "b"

VAN.$$LEA=4

VAN.$$P01=&B1111111111111111

VAN.$$P02=&B1010101010101010

BIT.16to32|v$$P01|v$$P02|b$$ERG

BIT.Show|b$$ERG|$$ERG|$$LEA

MBX.$$ERG

 

 

 

Syntax

 

BIT.16to32|[b/v]P1|[b/v]P2[|P3]

 

 

 

Parameter Explanation

 

P1 - Variable containing  a 16 bit numeric value.

    You can define with a prefix of "v" for value and "b" for "binary" which format the value is.

    If the prefix is omitted, "v" is the default setting for P1.

 

P2 - Variable containing  a 16 bit numeric value.

    You can define with a prefix of "v" for value and "b" for "binary" which format the value is.

    If the prefix is omitted, "v" is the default setting for P1.

 

P3  - optional,Variable for result.  If you use "-" the result is placed on the TOS. Also here you can specify [b/v] for the format of the result.
   If you do not specify anything the result is "value"-Format.

 

 

 

 

Example

 

'*****************************************************

' EXAMPLE 1:

'*****************************************************

' Having a Binary result, using "b"

VAN.$$LEA=4

VAN.$$P01=&B1111111111111111

VAN.$$P02=&B1010101010101010

BIT.16to32|v$$P01|v$$P02|b$$ERG

BIT.Show|b$$ERG|$$ERG|$$LEA

MBX.$$ERG

 

 

 

Remarks

-

 

 

Limitations:

-

 

 

See also:

 

3.5 Hexadezimal, Decimal and Binary and more

VTH. - Variable to Hexadecimal

VDC. - Variable Decrement

CAL. - mathematical CALculation

VAR. - Variable Set Value/Clear

VAN. - Variable Numeric

! Smart Package Robot 's BIT. - Operations

BIT.16to8 - Split 1 Word into 2 Bytes

BIT.16to32 - concatenate 2 Words to 32 Bit DWord

BIT.32to16 - Split 1 DWord into 2 Words

BIT.8to16 - concatenate 2 Bytes to 16 Bit Word

BIT.AND - Use logical AND with Bits

BIT.Clear - Set Bit to 0

BIT.LShift - Shift Bits to Left, insert 0

BIT.NOT - Use logical NOT with Bits

BIT.OR - Use logical OR with Bits

BIT.RotateLeft - Rotate Bits Left

BIT.RotateRight - Rotate Bits Right

BIT.RShift - Shift Bits to Right, insert 0

BIT.Set - Set Bit to 1

BIT.Show - Show Bits in Binary-Numbers

BIT.Store - Set Bit to 1 or 0

BIT.ToBin - change Parameter to Binary-Format

BIT.Toggle - Switch Bit

BIT.ToVal - change Parameter to Value-Format

BIT.XOR - Use logical XOR with Bits

BIT.Get - check if Bit is set