mirror of
https://github.com/irmen/prog8.git
synced 2025-11-24 06:17:39 +00:00
changed (and fixed) msb(long) and lsb(long)
This commit is contained in:
@@ -8,7 +8,7 @@ txt {
|
||||
sub width() -> ubyte {
|
||||
%ir {{
|
||||
syscall 46 (): r99000.w
|
||||
lsig.b r99100,r99000
|
||||
lsigb.w r99100,r99000
|
||||
returnr.b r99100
|
||||
}}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ sub width() -> ubyte {
|
||||
sub height() -> ubyte {
|
||||
%ir {{
|
||||
syscall 46 (): r99000.w
|
||||
msig.b r99100,r99000
|
||||
msigb.w r99100,r99000
|
||||
returnr.b r99100
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,10 @@ internal val constEvaluatorsForBuiltinFuncs: Map<String, ConstExpressionCaller>
|
||||
"sqrt__uword" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, false) { sqrt(it.toDouble()) } },
|
||||
"sqrt__float" to { a, p, prg -> oneFloatArgOutputFloat(a, p, prg) { sqrt(it) } },
|
||||
"lsb" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x and 255).toDouble() } },
|
||||
"lsb__long" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x and 255).toDouble() } },
|
||||
"lsw" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x and 65535).toDouble() } },
|
||||
"msb" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x ushr 8 and 255).toDouble()} },
|
||||
"msb__long" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x ushr 24 and 255).toDouble()} },
|
||||
"msw" to { a, p, prg -> oneIntArgOutputInt(a, p, prg, true) { x: Int -> (x ushr 16 and 65535).toDouble()} },
|
||||
"mkword" to ::builtinMkword,
|
||||
"mklong" to ::builtinMklong,
|
||||
|
||||
Reference in New Issue
Block a user