Vint, спасибо, я примерно так же подумал.
Вот мой код для 3-х байтного 12-битного числа. Вместо побитовых сдвигов использовал деление на 2^4 и 2^8 . Оформить можно и красивее, мне лишь бы работало)
logclear
#ps2_keyboard
$var = inputbox("×èñëî", 0, 30)
print($var+0x0)
//3rd byte
$b3 = ($var & 0xF00) /256 // >> 8
print("b3 : ",$b3)
//2nd byte
$b2 = ($var & 0x0F0) /16 // >> 4
print("b2 : ",$b2)
//1st byte
$b1 = $var & 0x00F
print("b1 : ",$b1)
if($var > 4095)
print("Out of Range!") // 0x0F00
wait(666666)
halt
end_if
switch($b3)
case(0)
$str = strconcat($str,"0")
case(0x1)
$str = strconcat($str,"1")
case(0x2)
$str = strconcat($str,"2")
case(0x3)
$str = strconcat($str,"3")
case(0x4)
$str = strconcat($str,"4")
case(0x5)
$str = strconcat($str,"5")
case(0x6)
$str = strconcat($str,"6")
case(0x7)
$str = strconcat($str,"7")
case(0x8)
$str = strconcat($str,"8")
case(0x9)
$str = strconcat($str,"9")
case(0xA)
$str = strconcat($str,"A")
case(0xB)
$str = strconcat($str,"B")
case(0xC)
$str = strconcat($str,"C")
case(0xD)
$str = strconcat($str,"D")
case(0xE)
$str = strconcat($str,"E")
case(0xF)
$str = strconcat($str,"F")
default
print("Error in b3")
wait(66666666)
halt
end_switch
switch($b2)
case(0)
$str = strconcat($str,"0")
case(0x1)
$str = strconcat($str,"1")
case(0x2)
$str = strconcat($str,"2")
case(0x3)
$str = strconcat($str,"3")
case(0x4)
$str = strconcat($str,"4")
case(0x5)
$str = strconcat($str,"5")
case(0x6)
$str = strconcat($str,"6")
case(0x7)
$str = strconcat($str,"7")
case(0x8)
$str = strconcat($str,"8")
case(0x9)
$str = strconcat($str,"9")
case(0xA)
$str = strconcat($str,"A")
case(0xB)
$str = strconcat($str,"B")
case(0xC)
$str = strconcat($str,"C")
case(0xD)
$str = strconcat($str,"D")
case(0xE)
$str = strconcat($str,"E")
case(0xF)
$str = strconcat($str,"F")
default
print("Error in b2")
wait(66666666)
halt
end_switch
switch($b1)
case(0)
$str = strconcat($str,"0")
case(0x1)
$str = strconcat($str,"1")
case(0x2)
$str = strconcat($str,"2")
case(0x3)
$str = strconcat($str,"3")
case(0x4)
$str = strconcat($str,"4")
case(0x5)
$str = strconcat($str,"5")
case(0x6)
$str = strconcat($str,"6")
case(0x7)
$str = strconcat($str,"7")
case(0x8)
$str = strconcat($str,"8")
case(0x9)
$str = strconcat($str,"9")
case(0xA)
$str = strconcat($str,"A")
case(0xB)
$str = strconcat($str,"B")
case(0xC)
$str = strconcat($str,"C")
case(0xD)
$str = strconcat($str,"D")
case(0xE)
$str = strconcat($str,"E")
case(0xF)
$str = strconcat($str,"F")
default
print("Error in b1")
wait(66666666)
halt
end_switch
print($str)
wait(555555)
halt