From 832a104c0ab094c085b41fa1f6e39ba76dd00653 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Wed, 31 Jul 2019 16:04:21 +0200 Subject: [PATCH] Added some reserved addresses for the BASIC sinus generation. --- .../kickc/passes/Pass4ZeroPageCoalesceCallGraph.java | 6 +++--- src/test/kc/examples/sinsprites/sinus-sprites.kc | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesceCallGraph.java b/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesceCallGraph.java index 904bf3af4..df277710a 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesceCallGraph.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesceCallGraph.java @@ -11,10 +11,10 @@ import java.util.*; /** * Use the call graph to coalesce zero page registers. - * For all variables: + * For each live range equivalence class: * - Look up through the call graph and avoid all variables declared in the scopes there - * - Go through the zero pages from low to high and try to coalesce with the lowest possible one. - * + * - Go through already handled live range equivalence classes and if any exist with no scope overlap with the call graph - try to coalesce + * - Add to the list of already handled live range equivalence classes */ public class Pass4ZeroPageCoalesceCallGraph extends Pass2Base { diff --git a/src/test/kc/examples/sinsprites/sinus-sprites.kc b/src/test/kc/examples/sinsprites/sinus-sprites.kc index a81055760..dbbb3405b 100644 --- a/src/test/kc/examples/sinsprites/sinus-sprites.kc +++ b/src/test/kc/examples/sinsprites/sinus-sprites.kc @@ -172,6 +172,9 @@ void gen_chargen_sprite(byte ch, byte* sprite) { asm { cli } } +// Reserve zeropage addresses used by the BASIC FP operations +#reserve(0x07, 0x0d, 0x0e, 0x12) + // Generate a sinus table using BASIC floats // - sintab is a pointer to the table to fill // - length is the length of the sine table