ErosOlmi
18-03-2007, 11:32
uses "console"
dim a,b,c as long
b = &H09700
c = &H03FFF
a = b and c
PrintResults("--- AND operation: a = b and c", a, b, c)
a = b or c
PrintResults("--- OR operation: a = b or c", a, b, c)
a = not b
PrintResults("--- NOT operation: a = not b ", a, b, c)
console_waitkey
function PrintResults(Operation as string, a as long, b as long, c as long)
console_writeline Operation
console_writeline "b = " & BIN$(b, 32) & " " & hex$(b, 4)
console_writeline "c = " & BIN$(c, 32) & " " & hex$(c, 4)
console_writeline string$(40, "-")
console_writeline "a = " & BIN$(a, 32) & " " & hex$(a, 4)
console_writeline ""
end function
dim a,b,c as long
b = &H09700
c = &H03FFF
a = b and c
PrintResults("--- AND operation: a = b and c", a, b, c)
a = b or c
PrintResults("--- OR operation: a = b or c", a, b, c)
a = not b
PrintResults("--- NOT operation: a = not b ", a, b, c)
console_waitkey
function PrintResults(Operation as string, a as long, b as long, c as long)
console_writeline Operation
console_writeline "b = " & BIN$(b, 32) & " " & hex$(b, 4)
console_writeline "c = " & BIN$(c, 32) & " " & hex$(c, 4)
console_writeline string$(40, "-")
console_writeline "a = " & BIN$(a, 32) & " " & hex$(a, 4)
console_writeline ""
end function