mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 01:29:28 +00:00
rnd() functions marked as having (internal) side effect
This commit is contained in:
parent
d1febc0208
commit
08aa13c90c
@ -1181,7 +1181,7 @@ $label nop""")
|
||||
out(" lda #<${asmVar} | ldy #>${asmVar} | jsr floats.MOVFM")
|
||||
}
|
||||
else -> {
|
||||
// todo evaluate directly into fac1 instead of via stack intermediate (add RegisterOrPair.FAC1 ??)
|
||||
// todo evaluate directly into fac1 instead of via stack intermediate (add RegisterOrPair.FAC1/FAC2 ??)
|
||||
translateExpression(returnvalue)
|
||||
out(" jsr floats.pop_float_fac1")
|
||||
}
|
||||
|
@ -130,9 +130,9 @@ private val functionSignatures: List<FSignature> = listOf(
|
||||
FSignature("lsb" , true, listOf(FParam("value", setOf(DataType.UWORD, DataType.WORD))), DataType.UBYTE) { a, p, prg -> oneIntArgOutputInt(a, p, prg) { x: Int -> x and 255 }},
|
||||
FSignature("msb" , true, listOf(FParam("value", setOf(DataType.UWORD, DataType.WORD))), DataType.UBYTE) { a, p, prg -> oneIntArgOutputInt(a, p, prg) { x: Int -> x ushr 8 and 255}},
|
||||
FSignature("mkword" , true, listOf(FParam("msb", setOf(DataType.UBYTE)), FParam("lsb", setOf(DataType.UBYTE))), DataType.UWORD, ::builtinMkword),
|
||||
FSignature("rnd" , true, emptyList(), DataType.UBYTE),
|
||||
FSignature("rndw" , true, emptyList(), DataType.UWORD),
|
||||
FSignature("rndf" , true, emptyList(), DataType.FLOAT),
|
||||
FSignature("rnd" , false, emptyList(), DataType.UBYTE),
|
||||
FSignature("rndw" , false, emptyList(), DataType.UWORD),
|
||||
FSignature("rndf" , false, emptyList(), DataType.FLOAT),
|
||||
FSignature("exit" , false, listOf(FParam("returnvalue", setOf(DataType.UBYTE))), null),
|
||||
FSignature("rsave" , false, emptyList(), null),
|
||||
FSignature("rrestore" , false, emptyList(), null),
|
||||
|
@ -27,6 +27,7 @@ main {
|
||||
BC[lp] = rnd() & 15
|
||||
DX[lp] = rnd() & 1
|
||||
DY[lp] = rnd() & 1
|
||||
void rnd()
|
||||
}
|
||||
|
||||
; start clock
|
||||
|
Loading…
Reference in New Issue
Block a user