added pokemon() function

This commit is contained in:
Irmen de Jong 2022-01-15 19:04:04 +01:00
parent 6fcb51cea2
commit 69f0c80cd7
3 changed files with 6 additions and 0 deletions

View File

@ -97,6 +97,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
"peekw" -> funcPeekW(fcall, resultToStack, resultRegister)
"peek" -> throw AssemblyError("peek() should have been replaced by @()")
"pokew" -> funcPokeW(fcall)
"pokemon" -> { /* meme function */ }
"poke" -> throw AssemblyError("poke() should have been replaced by @()")
"push", "pushw" -> funcPush(fcall, func)
"pop", "popw" -> funcPop(fcall, func)

View File

@ -141,6 +141,7 @@ private val functionSignatures: List<FSignature> = listOf(
FSignature("peek" , true, listOf(FParam("address", arrayOf(DataType.UWORD))), DataType.UBYTE),
FSignature("peekw" , true, listOf(FParam("address", arrayOf(DataType.UWORD))), DataType.UWORD),
FSignature("poke" , false, listOf(FParam("address", arrayOf(DataType.UWORD)), FParam("value", arrayOf(DataType.UBYTE))), null),
FSignature("pokemon" , false, listOf(FParam("address", arrayOf(DataType.UWORD)), FParam("value", arrayOf(DataType.UBYTE))), null),
FSignature("pokew" , false, listOf(FParam("address", arrayOf(DataType.UWORD)), FParam("value", arrayOf(DataType.UWORD))), null),
FSignature("pop" , false, listOf(FParam("target", ByteDatatypes)), null),
FSignature("popw" , false, listOf(FParam("target", WordDatatypes)), null),

View File

@ -896,6 +896,10 @@ poke(address, value)
pokew(address, value)
writes the word value at the given address in memory, in usual little-endian lsb/msb byte order.
pokemon(address, value)
Attempts to write a byte to a ROM at a location in machine language monitor bank.
Doesn't have anything to do with a certain video game.
push(value)
pushes a byte value on the CPU hardware stack. Lowlevel function that should normally not be used.