mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-25 20:32:25 +00:00
- Fixed #pragma nobank parameter issue.
- Optimized logic for #pragma bank. - Updated test cases and references. - Made #pragma NAME parameters optional. - Retested all test cases.
This commit is contained in:
parent
acbf8f073f
commit
477499b97b
@ -137,7 +137,7 @@ parameterDecl
|
||||
|
||||
pragma
|
||||
: PRAGMA NAME
|
||||
| PRAGMA NAME PAR_BEGIN pragmaParam (COMMA pragmaParam)* PAR_END
|
||||
| PRAGMA NAME (PAR_BEGIN pragmaParam (COMMA pragmaParam)* PAR_END)?
|
||||
;
|
||||
|
||||
pragmaParam
|
||||
@ -162,7 +162,7 @@ directive
|
||||
| EXTERN #directiveExtern
|
||||
| EXPORT #directiveExport
|
||||
| INLINE #directiveInline
|
||||
| BANK PAR_BEGIN NAME COMMA NUMBER (COMMA NAME COMMA NAME COMMA NAME)? PAR_END #directiveBank
|
||||
| BANK PAR_BEGIN NAME COMMA NUMBER PAR_END #directiveBank
|
||||
| INTRINSIC #directiveIntrinsic
|
||||
| INTERRUPT ( PAR_BEGIN NAME PAR_END )? #directiveInterrupt
|
||||
| LOCAL_RESERVE PAR_BEGIN pragmaParam ( COMMA pragmaParam )* PAR_END #directiveReserveZp
|
||||
|
@ -296,20 +296,15 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
break;
|
||||
case CParser.PRAGMA_BANK:
|
||||
try {
|
||||
final int size = ctx.getChildCount();
|
||||
if(size==7) {
|
||||
final String pragmaBankArea = pragmaParamName(ctx.pragmaParam(0));
|
||||
final Number pragmaBank = pragmaParamNumber(ctx.pragmaParam(1));
|
||||
this.currentBank = new Bank(pragmaBankArea, pragmaBank.longValue());
|
||||
} else {
|
||||
throw new CompileError("Expected at least 2 pragma parameters. Found '" + ctx.getText() + "'.", new StatementSource(ctx));
|
||||
}
|
||||
final String pragmaBankArea = pragmaParamName(ctx.pragmaParam(0));
|
||||
final Number pragmaBank = pragmaParamNumber(ctx.pragmaParam(1));
|
||||
this.currentBank = new Bank(pragmaBankArea, pragmaBank.longValue());
|
||||
} catch(IllegalArgumentException e) {
|
||||
throw new CompileError("Illegal parameter " + ctx.getText(), new StatementSource(ctx));
|
||||
}
|
||||
break;
|
||||
case CParser.PRAGMA_NOBANK:
|
||||
this.currentBank = null; // When the current far segment is null, any function that is far will be called as far.
|
||||
this.currentBank = null; // When the current segment is null, the procedure will not be declared as far.
|
||||
break;
|
||||
case CParser.PRAGMA_RESOURCE:
|
||||
String resourceFileName = pragmaParamString(pragmaParamSingle(ctx));
|
||||
|
@ -1,4 +1,29 @@
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be)
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,29 @@
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
@ -17,6 +43,6 @@ char plus(char a, char b) {
|
||||
}
|
||||
|
||||
#pragma code_seg(Code)
|
||||
#pragma nobank(dummy)
|
||||
#pragma nobank
|
||||
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
@ -16,7 +42,7 @@ char plus(char a, char b) {
|
||||
}
|
||||
|
||||
#pragma code_seg(Code)
|
||||
#pragma nobank(dummy)
|
||||
#pragma nobank
|
||||
char min(char a, char b) {
|
||||
return a+b;
|
||||
}
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
@ -22,4 +48,4 @@ char min(char a, char b) {
|
||||
}
|
||||
|
||||
#pragma code_seg(Code)
|
||||
#pragma nobank(dummy)
|
||||
#pragma nobank
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
@ -22,4 +48,4 @@ char min(char a, char b) {
|
||||
}
|
||||
|
||||
#pragma code_seg(RAM_Bank2)
|
||||
#pragma nobank(dummy)
|
||||
#pragma nobank
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
@ -22,4 +48,4 @@ char min(char a, char b) {
|
||||
}
|
||||
|
||||
#pragma code_seg(Code)
|
||||
#pragma nobank(dummy)
|
||||
#pragma nobank
|
||||
|
@ -1,4 +1,31 @@
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-stack-case-2-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2
|
||||
* The compiler will throw an error because the far call is a __stackcall
|
||||
* and this is not (yet) implemented and supported.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-stack.ld")
|
||||
|
||||
|
@ -1,4 +1,31 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-stack-case-5-far-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* The compiler will throw an error because the far call is a __stackcall
|
||||
* and this is not (yet) implemented and supported.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma link("call-banked-phi.ld")
|
||||
|
||||
|
@ -82,7 +82,7 @@ char mul_f(char m) {
|
||||
}
|
||||
|
||||
|
||||
#pragma nobank(dummy) // The sequent functions will consider no banking calculations anymore.
|
||||
#pragma nobank // The sequent functions will consider no banking calculations anymore.
|
||||
|
||||
#pragma code_seg(Bank1) // The sequent functions will be addressed specified by segment bank1 in the linker.
|
||||
// The __bank directive declares this function to be banked using call method ram in bank number 1 of banked ram.
|
||||
|
@ -1,4 +1,29 @@
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be)
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-1-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -157,7 +157,32 @@ Uplifting [] best 60 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be)
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-1-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -236,7 +261,32 @@ FINAL ASSEMBLER
|
||||
Score: 24
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be)
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-1-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,29 @@
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-1-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -226,7 +226,32 @@ Uplifting [] best 75 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-1-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -325,7 +350,32 @@ FINAL ASSEMBLER
|
||||
Score: 36
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #1
|
||||
/**
|
||||
* @file call-banked-phi-case-1-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #1
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-1-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-2-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -158,7 +158,33 @@ Uplifting [] best 75 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-2-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -243,7 +269,33 @@ FINAL ASSEMBLER
|
||||
Score: 39
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-2-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-2-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -158,7 +158,33 @@ Uplifting [] best 75 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-2-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -243,7 +269,33 @@ FINAL ASSEMBLER
|
||||
Score: 39
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #2
|
||||
/**
|
||||
* @file call-banked-phi-case-2-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #2.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-2-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-3-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-3-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -333,7 +359,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-3-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-3-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -20,7 +20,7 @@ plus::@return: scope:[plus] from plus
|
||||
[6] return
|
||||
to:@return
|
||||
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
min: scope:[min] from plus
|
||||
[7] phi()
|
||||
to:min::@return
|
||||
|
@ -38,7 +38,7 @@ plus::@return: scope:[plus] from plus::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
min: scope:[min] from plus
|
||||
min::b#1 = phi( plus/min::b#0 )
|
||||
min::a#1 = phi( plus/min::a#0 )
|
||||
@ -66,7 +66,7 @@ __constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
void main()
|
||||
char main::$0
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
char min::$0
|
||||
char min::a
|
||||
char min::a#0
|
||||
@ -188,7 +188,7 @@ plus::@return: scope:[plus] from plus
|
||||
[6] return
|
||||
to:@return
|
||||
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
min: scope:[min] from plus
|
||||
[7] phi()
|
||||
to:min::@return
|
||||
@ -199,7 +199,7 @@ min::@return: scope:[min] from min
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
void main()
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
char min::a
|
||||
char min::b
|
||||
char min::return
|
||||
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-3-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -315,7 +341,7 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
void main()
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
char min::a
|
||||
char min::b
|
||||
char min::return
|
||||
@ -333,7 +359,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #3
|
||||
/**
|
||||
* @file call-banked-phi-case-3-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #3.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-3-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
void main()
|
||||
char min(char a , char b)
|
||||
__bank(cx16_ram, 1) char min(char a , char b)
|
||||
char min::a
|
||||
char min::b
|
||||
char min::return
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-4-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-4-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -332,7 +358,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-4-near-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-4-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-4-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -332,7 +358,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-4-near-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #4.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-4-near-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-5-far-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-5-far-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -336,7 +362,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-5-far-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-5-far-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -227,7 +227,33 @@ Uplifting [] best 90 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-5-far-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -336,7 +362,33 @@ FINAL ASSEMBLER
|
||||
Score: 51
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #4
|
||||
/**
|
||||
* @file call-banked-phi-case-5-far-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #5.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-5-far-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-6-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -228,7 +228,33 @@ Uplifting [] best 105 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-6-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -339,7 +365,33 @@ FINAL ASSEMBLER
|
||||
Score: 66
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-0.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the __bank() directive.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-6-close-0.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
@ -1,4 +1,30 @@
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
.file [name="call-banked-phi-case-6-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
|
@ -228,7 +228,33 @@ Uplifting [] best 105 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-6-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -339,7 +365,33 @@ FINAL ASSEMBLER
|
||||
Score: 66
|
||||
|
||||
// File Comments
|
||||
// Test a procedure with calling convention PHI - case #6
|
||||
/**
|
||||
* @file call-banked-phi-case-6-close-1.c
|
||||
* @author Sven Van de Velde (sven.van.de.velde@telenet.be),
|
||||
* @author Jesper Gravgaard
|
||||
* @brief Test a procedure with calling convention PHI - case #6.
|
||||
* Implementation using the #pragma bank and nobank directives.
|
||||
* @version 0.1
|
||||
* @date 2023-04-11
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
* The following cases exist in banked calling implementations:
|
||||
*
|
||||
* - case #1 - unbanked to unbanked and no banking areas
|
||||
* - case #2 - unbanked to banked to any bank area
|
||||
* - case #3 - banked to unbanked from any bank area
|
||||
* - case #4 - banked to same bank in same bank area
|
||||
* - case #5 - banked to different bank in same bank area
|
||||
* - case #6 - banked to any bank between different bank areas
|
||||
*
|
||||
* This brings us to the call types:
|
||||
*
|
||||
* - near = case #1, #3, #4
|
||||
* - close = case #2, #6
|
||||
* - far = case #5
|
||||
*
|
||||
*/
|
||||
// Upstart
|
||||
.file [name="call-banked-phi-case-6-close-1.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
|
Loading…
Reference in New Issue
Block a user