"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/examples/manual/bits/hiword.bas" (31 Jan 2016, 734 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' examples/manual/bits/hiword.bas
    2 ''
    3 '' NOTICE: This file is part of the FreeBASIC Compiler package and can't
    4 ''         be included in other distributions without authorization.
    5 ''
    6 '' See Also: http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgHiword
    7 '' --------
    8 
    9 Dim N As UInteger
   10 
   11 'Note there are 32 bits
   12 N = &b10000000000000011111111111111111
   13 
   14 Print "N is                                       "; N
   15 Print "The binary representation of N is          "; Bin(N)
   16 Print "The most significant word (MSW) of N is    "; HiWord(N)
   17 Print "The least significant word (LSW) of N is   "; LoWord(N)
   18 Print "The binary representation of the MSW is    "; Bin(HiWord(N))
   19 Print "The binary representation of the LSW is    "; Bin(LoWord(N))
   20 
   21 Sleep