From 1ee3f826cc818693e74075fb2d349054cf73fd50 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 28 May 2023 14:02:24 +0200 Subject: [PATCH] fix sqrt() regression --- .../src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt index edfafc528..9ae32b906 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt @@ -274,7 +274,7 @@ internal class BuiltinFunctionsAsmGen(private val program: PtProgram, private fun funcSqrt(fcall: PtBuiltinFunctionCall, resultToStack: Boolean, resultRegister: RegisterOrPair?, scope: IPtSubroutine?) { translateArguments(fcall, scope) - when(fcall.type) { + when(fcall.args[0].type) { DataType.UBYTE -> { if(resultToStack) asmgen.out(" ldy #0 | jsr prog8_lib.func_sqrt16_stack")