mirror of
https://github.com/irmen/prog8.git
synced 2026-04-20 11:17:01 +00:00
added sys.push() and sys.pop() to put values on cpu stack. Added missing builtin functions to syntax-files.
This commit is contained in:
@@ -67,6 +67,8 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
"peek" -> throw AssemblyError("peek() should have been replaced by @()")
|
||||
"pokew" -> funcPokeW(fcall)
|
||||
"poke" -> throw AssemblyError("poke() should have been replaced by @()")
|
||||
// "push", "pushw" -> funcPush(fcall, func)
|
||||
// "pop", "popw" -> funcPop(func)
|
||||
"cmp" -> funcCmp(fcall)
|
||||
"callfar" -> funcCallFar(fcall)
|
||||
"callrom" -> funcCallRom(fcall)
|
||||
@@ -74,6 +76,30 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
}
|
||||
}
|
||||
|
||||
// private fun funcPop(func: FSignature) {
|
||||
// if(func.name=="pop") {
|
||||
// asmgen.out(" pla")
|
||||
// } else {
|
||||
// if (asmgen.isTargetCpu(CpuType.CPU65c02))
|
||||
// asmgen.out(" ply | pla")
|
||||
// else
|
||||
// asmgen.out(" pla | tay | pla")
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private fun funcPush(fcall: IFunctionCall, func: FSignature) {
|
||||
// if(func.name=="push") {
|
||||
// asmgen.assignExpressionToRegister(fcall.args[0], RegisterOrPair.A)
|
||||
// asmgen.out(" pha")
|
||||
// } else {
|
||||
// asmgen.assignExpressionToRegister(fcall.args[0], RegisterOrPair.AY)
|
||||
// if (asmgen.isTargetCpu(CpuType.CPU65c02))
|
||||
// asmgen.out(" pha | phy")
|
||||
// else
|
||||
// asmgen.out(" pha | tya | pha")
|
||||
// }
|
||||
// }
|
||||
|
||||
private fun funcCallFar(fcall: IFunctionCall) {
|
||||
if(asmgen.options.compTarget !is Cx16Target)
|
||||
throw AssemblyError("callfar only works on cx16 target at this time")
|
||||
|
||||
Reference in New Issue
Block a user