From 02d9eaf0817ee6286dca94128742cfe969eac90c Mon Sep 17 00:00:00 2001 From: Sven Van de Velde Date: Wed, 12 Apr 2023 06:57:25 +0200 Subject: [PATCH] - Added banking signature to procedures in the comments of the assembler output file. - Update test cases and reference data. - Cleaned old test cases for stack calls. --- .../java/dk/camelot64/kickc/model/Bank.java | 9 ++- .../kickc/passes/Pass4CodeGeneration.java | 10 +++- ...procedure-callingconvention-stack-bank-0.c | 16 ----- ...procedure-callingconvention-stack-bank-1.c | 18 ------ ...procedure-callingconvention-stack-bank-2.c | 24 -------- ...procedure-callingconvention-stack-bank-3.c | 59 ------------------- ...procedure-callingconvention-stack-bank-4.c | 39 ------------ ...procedure-callingconvention-stack-bank-5.c | 22 ------- .../procedure-callingconvention-stack-bank.ld | 6 -- .../ref/call-banked-phi-case-2-close-0.asm | 1 + .../ref/call-banked-phi-case-2-close-0.log | 2 + .../ref/call-banked-phi-case-2-close-1.asm | 1 + .../ref/call-banked-phi-case-2-close-1.log | 2 + .../ref/call-banked-phi-case-3-near-0.asm | 1 + .../ref/call-banked-phi-case-3-near-0.log | 2 + .../ref/call-banked-phi-case-3-near-1.asm | 1 + .../ref/call-banked-phi-case-3-near-1.log | 2 + .../ref/call-banked-phi-case-4-near-0.asm | 2 + .../ref/call-banked-phi-case-4-near-0.log | 4 ++ .../ref/call-banked-phi-case-4-near-1.asm | 2 + .../ref/call-banked-phi-case-4-near-1.log | 4 ++ src/test/ref/call-banked-phi-case-5-far-0.asm | 2 + src/test/ref/call-banked-phi-case-5-far-0.log | 4 ++ src/test/ref/call-banked-phi-case-5-far-1.asm | 2 + src/test/ref/call-banked-phi-case-5-far-1.log | 4 ++ .../ref/call-banked-phi-case-6-close-0.asm | 2 + .../ref/call-banked-phi-case-6-close-0.log | 4 ++ .../ref/call-banked-phi-case-6-close-1.asm | 2 + .../ref/call-banked-phi-case-6-close-1.log | 4 ++ 29 files changed, 65 insertions(+), 186 deletions(-) delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-0.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-1.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-2.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-3.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-4.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank-5.c delete mode 100644 src/test/kc/procedure-callingconvention-stack-bank.ld diff --git a/src/main/java/dk/camelot64/kickc/model/Bank.java b/src/main/java/dk/camelot64/kickc/model/Bank.java index ec111abb3..b080bc0e4 100644 --- a/src/main/java/dk/camelot64/kickc/model/Bank.java +++ b/src/main/java/dk/camelot64/kickc/model/Bank.java @@ -103,7 +103,7 @@ package dk.camelot64.kickc.model; * The KickC compiler contains several test cases and examples which demonstrate the usage of the banking system. * */ -public class Bank { +public class Bank extends Object { private final String bankArea; // The bank method to apply. private Long bank; // The bank number. @@ -132,4 +132,11 @@ public class Bank { public void setBank(Long bank) { this.bank = bank; } + + @Override + public String toString() { + return "banked : " + + "bank area='" + bankArea + '\'' + + ", bank=" + bank; + } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java index b3877765d..177d137b9 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java @@ -219,7 +219,8 @@ public class Pass4CodeGeneration { } /** - * Generate a comment that describes the procedure signature and parameter transfer + * Generate a comment that describes the procedure signature and parameter transfer. + * We have added here also the banking information. * * @param asm The assembler program being generated * @param procedure The procedure @@ -240,6 +241,13 @@ public class Pass4CodeGeneration { if (i > 0) { asm.addComment(signature.toString(), false); } + // Banking information of the procedure. + Bank bank = procedure.getBankLocation(); + if(bank != null) { + StringBuilder signatureBank = new StringBuilder(); + signatureBank.append(" " + bank.toString()); // This procedure is in a bank and in a banking area. + asm.addComment(signatureBank.toString(), false); + } } /** diff --git a/src/test/kc/procedure-callingconvention-stack-bank-0.c b/src/test/kc/procedure-callingconvention-stack-bank-0.c deleted file mode 100644 index d0394b9d1..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-0.c +++ /dev/null @@ -1,16 +0,0 @@ -// Test a procedure with calling convention stack - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma target(cx16) - -char* const SCREEN = (char*)0x0400; - -void main(void) { - SCREEN[0] = plus('0', 7); -} - -#pragma code_seg(stage) -char __bank(ram, 2) __stackcall plus(char a, char b) { - return a+b; -} \ No newline at end of file diff --git a/src/test/kc/procedure-callingconvention-stack-bank-1.c b/src/test/kc/procedure-callingconvention-stack-bank-1.c deleted file mode 100644 index c1ac83207..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-1.c +++ /dev/null @@ -1,18 +0,0 @@ -// Test a procedure with calling convention stack - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma target(cx16) - -char* const SCREEN = (char*)0x0400; - -void main(void) { - SCREEN[0] = plus('0', 7); -} - -#pragma calling(__stackcall) -#pragma code_seg(stage) - -char __bank(ram,20) plus(char a, char b) { - return a+b; -} \ No newline at end of file diff --git a/src/test/kc/procedure-callingconvention-stack-bank-2.c b/src/test/kc/procedure-callingconvention-stack-bank-2.c deleted file mode 100644 index cba3de4b9..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-2.c +++ /dev/null @@ -1,24 +0,0 @@ -// Test a procedure with calling convention stack -// A slightly more complex call - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma target(cx16) - -char* const SCREEN = (char*)0x0400; - -char i = 0; - -void main(void) { - for(char a:0..1) { - char v = a+1; - char w = plus('0', v); - SCREEN[i] = w+a; - } -} - -// this should give a pragma error during compile, as test is not declared yet. -char __bank(ram, 20) __stackcall plus(char a, char b) { - i++; - return a+b; -} \ No newline at end of file diff --git a/src/test/kc/procedure-callingconvention-stack-bank-3.c b/src/test/kc/procedure-callingconvention-stack-bank-3.c deleted file mode 100644 index 97313f42e..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-3.c +++ /dev/null @@ -1,59 +0,0 @@ -// Test a procedure with calling convention stack -// Illustrates live range problem with function variable printother::i and global variable val - -#pragma calling(__stackcall) - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma target(cx16) - -char* const SCREEN = (char*)0x0400; - -char val = 0; - -void main(void) { - for(char i:0..5) { - pval(); - printother(); - ival(); - } -} - -#pragma code_seg(stage) - -void __bank(ram, 20) pval() { - printval(); -} - -#pragma code_seg(platform) - -void __bank(ram, 21) ival() { - incval(); -} - -#pragma code_seg(stage) - -void __bank(ram, 20) printval() { - SCREEN[0] = val; -} - - -#pragma code_seg(platform) - -void __bank(ram, 21) incval() { - val++; -} - -#pragma nobank -#pragma code_seg(Code) - -void printother() { - for(char i:0..5) { - (SCREEN+40)[i]++; - } -} - - - - - diff --git a/src/test/kc/procedure-callingconvention-stack-bank-4.c b/src/test/kc/procedure-callingconvention-stack-bank-4.c deleted file mode 100644 index bb3ebc6e8..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-4.c +++ /dev/null @@ -1,39 +0,0 @@ -// Test a procedure with calling convention stack -// Returning and passing struct values - -#pragma calling(__stackcall) -#pragma struct_model(classic) - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma target(cx16) - -char* const SCREEN = (char*)0x0400; -char idx = 0; - -struct Point { - char x; - char y; -}; - -void main(void) { - for(char i=0;i<5;i++) { - struct Point p = get(i); - print(p); - } -} - -struct Point __bank(ram,1) get(char i) { - struct Point p = { i, i/2 }; - return p; -} - -void __bank(ram,2) print(struct Point p) { - SCREEN[idx++] = p.x; - SCREEN[idx++] = p.y; -} - - - - - diff --git a/src/test/kc/procedure-callingconvention-stack-bank-5.c b/src/test/kc/procedure-callingconvention-stack-bank-5.c deleted file mode 100644 index ce0701c6f..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank-5.c +++ /dev/null @@ -1,22 +0,0 @@ -// Test a procedure with calling convention stack -// Recursion that works (no local variables) - -#pragma code_seg(stage) -#pragma link("procedure-callingconvention-stack-bank.ld") -#pragma platform(cx16) - -char* const SCREEN = (char*)0x0400; - -void main(void) { - *SCREEN = pow2(6); -} - -char __stackcall __bank(ram,1) pow2(char n) { - if (n == 0) - return 1; - else { - char c = pow2(n-1); - return c+c; - } - -} \ No newline at end of file diff --git a/src/test/kc/procedure-callingconvention-stack-bank.ld b/src/test/kc/procedure-callingconvention-stack-bank.ld deleted file mode 100644 index 3e9cecaee..000000000 --- a/src/test/kc/procedure-callingconvention-stack-bank.ld +++ /dev/null @@ -1,6 +0,0 @@ -.segmentdef Program [segments="Basic, Code, Data, stage, platform"] -.segmentdef Basic [start=$0801] -.segmentdef Code [start=%P] -.segmentdef Data [startAfter="Code"] -.segmentdef stage [start=$0400, min=$0400, max=$07FF, align=$100] -.segmentdef platform [start=$C000, min=$C000, max=$C7FF, align=$100] diff --git a/src/test/ref/call-banked-phi-case-2-close-0.asm b/src/test/ref/call-banked-phi-case-2-close-0.asm index 345d208bb..349ff29d6 100644 --- a/src/test/ref/call-banked-phi-case-2-close-0.asm +++ b/src/test/ref/call-banked-phi-case-2-close-0.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 diff --git a/src/test/ref/call-banked-phi-case-2-close-0.log b/src/test/ref/call-banked-phi-case-2-close-0.log index e58f419ff..3ea76d170 100644 --- a/src/test/ref/call-banked-phi-case-2-close-0.log +++ b/src/test/ref/call-banked-phi-case-2-close-0.log @@ -229,6 +229,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 @@ -338,6 +339,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 diff --git a/src/test/ref/call-banked-phi-case-2-close-1.asm b/src/test/ref/call-banked-phi-case-2-close-1.asm index e59df026e..be3c04747 100644 --- a/src/test/ref/call-banked-phi-case-2-close-1.asm +++ b/src/test/ref/call-banked-phi-case-2-close-1.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 diff --git a/src/test/ref/call-banked-phi-case-2-close-1.log b/src/test/ref/call-banked-phi-case-2-close-1.log index 0e29a8ff2..0413d3865 100644 --- a/src/test/ref/call-banked-phi-case-2-close-1.log +++ b/src/test/ref/call-banked-phi-case-2-close-1.log @@ -229,6 +229,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 @@ -338,6 +339,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .const a = '0' .const b = 7 diff --git a/src/test/ref/call-banked-phi-case-3-near-0.asm b/src/test/ref/call-banked-phi-case-3-near-0.asm index e7e644763..599c148cd 100644 --- a/src/test/ref/call-banked-phi-case-3-near-0.asm +++ b/src/test/ref/call-banked-phi-case-3-near-0.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 diff --git a/src/test/ref/call-banked-phi-case-3-near-0.log b/src/test/ref/call-banked-phi-case-3-near-0.log index 7720bf87c..cdc88a695 100644 --- a/src/test/ref/call-banked-phi-case-3-near-0.log +++ b/src/test/ref/call-banked-phi-case-3-near-0.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -428,6 +429,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 diff --git a/src/test/ref/call-banked-phi-case-3-near-1.asm b/src/test/ref/call-banked-phi-case-3-near-1.asm index f4440cd98..7f5a14078 100644 --- a/src/test/ref/call-banked-phi-case-3-near-1.asm +++ b/src/test/ref/call-banked-phi-case-3-near-1.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 diff --git a/src/test/ref/call-banked-phi-case-3-near-1.log b/src/test/ref/call-banked-phi-case-3-near-1.log index 3ed463fde..834f647f1 100644 --- a/src/test/ref/call-banked-phi-case-3-near-1.log +++ b/src/test/ref/call-banked-phi-case-3-near-1.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -428,6 +429,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 diff --git a/src/test/ref/call-banked-phi-case-4-near-0.asm b/src/test/ref/call-banked-phi-case-4-near-0.asm index 3972e6016..e43e78962 100644 --- a/src/test/ref/call-banked-phi-case-4-near-0.asm +++ b/src/test/ref/call-banked-phi-case-4-near-0.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -66,6 +67,7 @@ plus: { rts } // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-4-near-0.log b/src/test/ref/call-banked-phi-case-4-near-0.log index 62c366a98..204e49501 100644 --- a/src/test/ref/call-banked-phi-case-4-near-0.log +++ b/src/test/ref/call-banked-phi-case-4-near-0.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -313,6 +314,7 @@ plus: { } // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b jmp __breturn @@ -427,6 +429,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -441,6 +444,7 @@ plus: { } // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b // min::@return diff --git a/src/test/ref/call-banked-phi-case-4-near-1.asm b/src/test/ref/call-banked-phi-case-4-near-1.asm index 2f6e45907..e51f01278 100644 --- a/src/test/ref/call-banked-phi-case-4-near-1.asm +++ b/src/test/ref/call-banked-phi-case-4-near-1.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -66,6 +67,7 @@ plus: { rts } // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-4-near-1.log b/src/test/ref/call-banked-phi-case-4-near-1.log index 38ccd800f..98d448864 100644 --- a/src/test/ref/call-banked-phi-case-4-near-1.log +++ b/src/test/ref/call-banked-phi-case-4-near-1.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -313,6 +314,7 @@ plus: { } // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b jmp __breturn @@ -427,6 +429,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -441,6 +444,7 @@ plus: { } // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=1 min: { .label return = plus.a+plus.b // min::@return diff --git a/src/test/ref/call-banked-phi-case-5-far-0.asm b/src/test/ref/call-banked-phi-case-5-far-0.asm index a1d1eaba5..df153f403 100644 --- a/src/test/ref/call-banked-phi-case-5-far-0.asm +++ b/src/test/ref/call-banked-phi-case-5-far-0.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -70,6 +71,7 @@ plus: { } .segment RAM_Bank2 // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-5-far-0.log b/src/test/ref/call-banked-phi-case-5-far-0.log index 5e7710384..01cc81e12 100644 --- a/src/test/ref/call-banked-phi-case-5-far-0.log +++ b/src/test/ref/call-banked-phi-case-5-far-0.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -317,6 +318,7 @@ plus: { .segment RAM_Bank2 // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b jmp __breturn @@ -431,6 +433,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -449,6 +452,7 @@ plus: { .segment RAM_Bank2 // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b // min::@return diff --git a/src/test/ref/call-banked-phi-case-5-far-1.asm b/src/test/ref/call-banked-phi-case-5-far-1.asm index 8b9f8b367..a45533f07 100644 --- a/src/test/ref/call-banked-phi-case-5-far-1.asm +++ b/src/test/ref/call-banked-phi-case-5-far-1.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -70,6 +71,7 @@ plus: { } .segment RAM_Bank2 // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-5-far-1.log b/src/test/ref/call-banked-phi-case-5-far-1.log index 63e6a0ff3..843a67794 100644 --- a/src/test/ref/call-banked-phi-case-5-far-1.log +++ b/src/test/ref/call-banked-phi-case-5-far-1.log @@ -298,6 +298,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -317,6 +318,7 @@ plus: { .segment RAM_Bank2 // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b jmp __breturn @@ -431,6 +433,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -449,6 +452,7 @@ plus: { .segment RAM_Bank2 // min // char min(char a, char b) +// banked : bank area='cx16_ram', bank=2 min: { .label return = plus.a+plus.b // min::@return diff --git a/src/test/ref/call-banked-phi-case-6-close-0.asm b/src/test/ref/call-banked-phi-case-6-close-0.asm index 503c5ad0f..006ba06a2 100644 --- a/src/test/ref/call-banked-phi-case-6-close-0.asm +++ b/src/test/ref/call-banked-phi-case-6-close-0.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -72,6 +73,7 @@ plus: { } .segment ROM_Bank1 // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-6-close-0.log b/src/test/ref/call-banked-phi-case-6-close-0.log index e6a9fd619..50c042ba4 100644 --- a/src/test/ref/call-banked-phi-case-6-close-0.log +++ b/src/test/ref/call-banked-phi-case-6-close-0.log @@ -299,6 +299,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -320,6 +321,7 @@ plus: { .segment ROM_Bank1 // min // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b jmp __breturn @@ -434,6 +436,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -454,6 +457,7 @@ plus: { .segment ROM_Bank1 // min // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b // min::@return diff --git a/src/test/ref/call-banked-phi-case-6-close-1.asm b/src/test/ref/call-banked-phi-case-6-close-1.asm index 99c634672..b893a61f0 100644 --- a/src/test/ref/call-banked-phi-case-6-close-1.asm +++ b/src/test/ref/call-banked-phi-case-6-close-1.asm @@ -57,6 +57,7 @@ main: { } .segment RAM_Bank1 // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -72,6 +73,7 @@ plus: { } .segment ROM_Bank1 // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b rts diff --git a/src/test/ref/call-banked-phi-case-6-close-1.log b/src/test/ref/call-banked-phi-case-6-close-1.log index 4de0578ce..38195d985 100644 --- a/src/test/ref/call-banked-phi-case-6-close-1.log +++ b/src/test/ref/call-banked-phi-case-6-close-1.log @@ -299,6 +299,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -320,6 +321,7 @@ plus: { .segment ROM_Bank1 // min // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b jmp __breturn @@ -434,6 +436,7 @@ main: { .segment RAM_Bank1 // plus // char plus(char a, char b) +// banked : bank area='cx16_ram', bank=1 plus: { .label a = '0' .label b = 7 @@ -454,6 +457,7 @@ plus: { .segment ROM_Bank1 // min // char min(char a, char b) +// banked : bank area='cx16_rom', bank=1 min: { .label return = plus.a+plus.b // min::@return