WORD.Make |
![]() ![]() |
out = WORD.Make( BYVAL lowbyte AS INTEGER, BYVAL highbyte AS INTEGER ) AS INTEGER
The WORD.MAKE function creates an INTEGER with the lower 16 bits set by concatenating the specified values. Same as MAKEWORD Win32 macro.
Example:
$LIBRARY "MyBASIC2_ExtLib.dll"
CLS
PRINT "BIT.AND( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.AND( 0x00110011, 0x00100010 ) ), PRINT "BIT.OR( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.OR( 0x00110011, 0x00100010 ) ), PRINT "BIT.XOR( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.XOR( 0x00110011, 0x00100010 ) ), PRINT "BIT.NOT( 0x0F11F00E ) = 0x";FORMAT( "%08X", BIT.NOT( 0x0F11F00E ) ),
PRINT "BIT.SHIFT( 0x00000011 ) << 1 = 0x";FORMAT( "%08X", BIT.SHIFT( 0x00000011, -1 ) ), PRINT "BIT.SHIFT( 0x11000000 ) >> 7 = 0x";FORMAT( "%08X", BIT.SHIFT( 0x11000000, 7 ) ),
PRINT "BYTE.HI( BIT.NOT( 0x00002211 ) ) = 0x";FORMAT( "%08X", BYTE.HI( BIT.NOT( 0x00002211 ) ) ), PRINT "BYTE.LO( BIT.NOT( 0x00002211 ) ) = 0x";FORMAT( "%08X", BYTE.LO( BIT.NOT( 0x00002211 ) ) ),
PRINT "WORD.MAKE( 0x21, 0x43 ) = 0x";FORMAT( "%08X", WORD.MAKE( 0x21, 0x43 ) ),
PRINT "WORD.HI( BIT.NOT( 0x0F11F00E ) ) = 0x";FORMAT( "%08X", WORD.HI( BIT.NOT( 0x0F11F00E ) ) ), PRINT "WORD.LO( BIT.NOT( 0x0F11F00E ) ) = 0x";FORMAT( "%08X", WORD.LO( BIT.NOT( 0x0F11F00E ) ) ),
PRINT "LONG.MAKE( 0x12, 0x34 ) = 0x";FORMAT( "%08X", LONG.MAKE( 0x12, 0x34 ) ),
END |