Added a new .MACPACK CBM
git-svn-id: svn://svn.cc65.org/cc65/trunk@2142 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -50,7 +50,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Predefined packages */
|
/* Predefined packages */
|
||||||
static char MacGeneric [] = /* Generic macros */
|
|
||||||
|
/* Generic macros */
|
||||||
|
static char MacGeneric[] =
|
||||||
".macro add Arg1, Arg2\n"
|
".macro add Arg1, Arg2\n"
|
||||||
" clc\n"
|
" clc\n"
|
||||||
" .if .paramcount = 2\n"
|
" .if .paramcount = 2\n"
|
||||||
@@ -68,9 +70,8 @@ static char MacGeneric [] = /* Generic macros */
|
|||||||
" .endif\n"
|
" .endif\n"
|
||||||
".endmacro\n";
|
".endmacro\n";
|
||||||
|
|
||||||
|
/* Long branch macros */
|
||||||
|
static char MacLongBranch[] =
|
||||||
static char MacLongBranch [] = /* Long branch macros */
|
|
||||||
".macro jeq Target\n"
|
".macro jeq Target\n"
|
||||||
" .if .match(Target, 0)\n"
|
" .if .match(Target, 0)\n"
|
||||||
" bne *+5\n"
|
" bne *+5\n"
|
||||||
@@ -160,12 +161,36 @@ static char MacLongBranch [] = /* Long branch macros */
|
|||||||
" .endif\n"
|
" .endif\n"
|
||||||
".endmacro\n";
|
".endmacro\n";
|
||||||
|
|
||||||
|
/* Commodore specific macros */
|
||||||
|
static char MacCBM[] =
|
||||||
|
".macro scrcode str\n"
|
||||||
|
" .repeat .strlen(str), i\n"
|
||||||
|
" .if (.strat(str, i) >= '@' .and .strat(str, i) <= 'z')\n"
|
||||||
|
" .byte .strat(str, i) - '@'\n"
|
||||||
|
" .elseif (.strat(str, i) >= 'A' .and .strat(str, i) <= 'Z')\n"
|
||||||
|
" .byte .strat(str, i) - 'A' + 65\n"
|
||||||
|
" .elseif (.strat(str, i) = '[')\n"
|
||||||
|
" .byte 27\n"
|
||||||
|
" .elseif (.strat(str, i) = ']')\n"
|
||||||
|
" .byte 29\n"
|
||||||
|
" .elseif (.strat(str, i) = '^')\n"
|
||||||
|
" .byte 30\n"
|
||||||
|
" .elseif (.strat(str, i) = '_')\n"
|
||||||
|
" .byte 31\n"
|
||||||
|
" .else\n"
|
||||||
|
" .byte .strat(str, i)\n"
|
||||||
|
" .endif\n"
|
||||||
|
" .endrepeat\n"
|
||||||
|
".endmacro\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Table with pointers to the different packages */
|
/* Table with pointers to the different packages */
|
||||||
static char* MacPackages [] = {
|
static char* MacPackages [] = {
|
||||||
MacGeneric,
|
MacGeneric,
|
||||||
MacLongBranch,
|
MacLongBranch,
|
||||||
|
MacCBM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
/* Constants for the predefined packages */
|
/* Constants for the predefined packages */
|
||||||
#define MAC_GENERIC 0
|
#define MAC_GENERIC 0
|
||||||
#define MAC_LONGBRANCH 1
|
#define MAC_LONGBRANCH 1
|
||||||
|
#define MAC_CBM 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1052,8 +1052,9 @@ static void DoMacPack (void)
|
|||||||
{
|
{
|
||||||
/* Macro package names */
|
/* Macro package names */
|
||||||
static const char* Keys [] = {
|
static const char* Keys [] = {
|
||||||
"GENERIC",
|
"GENERIC",
|
||||||
"LONGBRANCH",
|
"LONGBRANCH",
|
||||||
|
"CBM"
|
||||||
};
|
};
|
||||||
|
|
||||||
int Package;
|
int Package;
|
||||||
|
|||||||
Reference in New Issue
Block a user