#define MAX_VALUES 32
#define IOBUFFERS 256
+uae_u32 get_byte_debug(uaecptr addr);
+uae_u32 get_word_debug(uaecptr addr);
+uae_u32 get_long_debug(uaecptr addr);
+int getregidx(TCHAR **c);
+uae_u32 returnregx(int regid);
+
static double parsedvaluesd[MAX_VALUES];
static TCHAR *parsedvaluess[MAX_VALUES];
static int op_preced(const TCHAR c)
{
switch(c) {
+ case 0xf0: case 0xf1: case 0xf2:
case '!':
return 4;
case '*': case '/': case '\\': case '%':
// left to right
case '*': case '/': case '%': case '+': case '-':
case '|': case '&': case '^':
+ case 0xf0: case 0xf1: case 0xf2:
return true;
// right to left
case '=': case '!': case '@': case '@' | 0x80: case '>': case '<': case '>' | 0x80: case '<' | 0x80:
return 2;
case '!':
case ':':
+ case 0xf0: case 0xf1: case 0xf2:
return 1;
default:
return c - 'A';
#define is_operator(c) (c == '+' || c == '-' || c == '/' || c == '*' || c == '!' || c == '%' || c == '=' || \
c == '|' || c == '&' || c == '^' || c == '@' || c == ('@' | 0x80) || c == '>' || c == '<' || c == ('>' | 0x80) || c == ('<' | 0x80) || \
- c == '?' || c == ':')
+ c == '?' || c == ':' || c == 0xf0 || c == 0xf1 || c == 0xf2)
#define is_function(c) (c >= 'A' && c <= 'Z')
#define is_ident(c) ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z'))
case ':':
v = v1;
break;
+ case 0xf0:
+ v = get_byte_debug((uaecptr)v1);
+ break;
+ case 0xf1:
+ v = get_word_debug((uaecptr)v1);
+ break;
+ case 0xf2:
+ v = get_long_debug((uaecptr)v1);
+ break;
+
default:
return false;
}
in[2] = ' ';
in[3] = ' ';
in[4] = ' ';
- } else if (in[0] == '>' && in[1] == '>') {
+ } else if (!_tcsncmp(in, _T("rl("), 3)) {
+ in[0] = 0xf2;
+ in[1] = ' ';
+ } else if (!_tcsncmp(in, _T("rw("), 3)) {
+ in[0] = 0xf1;
+ in[1] = ' ';
+ } else if (!_tcsncmp(in, _T("rb("), 3)) {
+ in[0] = 0xf0;
+ in[1] = ' ';
+ } else if (in[0] == '>' && in[1] == '>') {
in[0] = '>' | 0x80;
in[1] = ' ';
} else if (in[0] == '<' && in[1] == '<') {
*in = '@' | 0x80;
*(in + 1) = ' ';
}
- if (_istdigit (*in)) {
+ if (_totupper (*in) == 'R') {
+ if (ident >= MAX_VALUES)
+ return false;
+ TCHAR *tmpp = in + 1;
+ int idx = getregidx(&tmpp);
+ if (idx >= 0) {
+ *p++ = ident + 'a';
+ uae_u32 val = returnregx(idx);
+ parsedvaluesd[ident++] = val;
+ in = tmpp;
+ } else {
+ in++;
+ }
+ op = 0;
+ } else if (_istxdigit(*in) || *in == '$') {
if (ident >= MAX_VALUES)
return false;
- if (op > 1 && (in[-1] == '-' || in[-1] == '+')) {
- instart--;
- p--;
- }
- *p++ = ident + 'a';
- while (_istdigit (*in) || *in == '.')
- in++;
- tmp = *in;
- *in = 0;
- parsedvaluesd[ident++] = _tstof (instart);
- *in = tmp;
+ if (op > 1 && (in[-1] == '-' || in[-1] == '+')) {
+ instart--;
+ p--;
+ }
+ *p++ = ident + 'a';
+ bool hex = false;
+ if (*in == '$') {
+ in++;
+ hex = true;
+ }
+ if (!hex) {
+ TCHAR *tmpp = in;
+ while (_istxdigit(*tmpp)) {
+ tmp = _totupper(*tmpp);
+ if (tmp >= 'A' && tmp <= 'F') {
+ hex = true;
+ }
+ tmpp++;
+ }
+ }
+ if (hex) {
+ uae_u32 val = 0;
+ while (_istxdigit(*in)) {
+ val *= 16;
+ TCHAR c = _totupper(*in);
+ if (_istdigit(c)) {
+ val += c - '0';
+ } else {
+ val += c - 'A' + 10;
+ }
+ in++;
+ }
+ parsedvaluesd[ident++] = val;
+ } else {
+ while (_istdigit(*in) || *in == '.')
+ in++;
+ tmp = *in;
+ *in = 0;
+ parsedvaluesd[ident++] = _tstof(instart);
+ *in = tmp;
+ }
op = 0;
} else {
if (is_operator(*in))
static bool isoperator(TCHAR **cp)
{
- TCHAR c = **cp;
- return c == '+' || c == '-' || c == '/' || c == '*' || c == '(' || c == ')' || c == '|' || c == '&' || c == '^' || c == '=' || c == '>' || c == '<';
+ TCHAR c = _totupper(**cp);
+ TCHAR c1 = _totupper((*cp)[1]);
+ return c == '+' || c == '-' || c == '/' || c == '*' || c == '(' || c == ')' ||
+ c == '|' || c == '&' || c == '^' || c == '=' || c == '>' || c == '<' ||
+ (c == 'R' && (c1 == 'L' || c1 == 'W' || c1 == 'B'));
}
static void ignore_ws (TCHAR **c)
NULL
};
-static int getregidx(TCHAR **c)
+int getregidx(TCHAR **c)
{
int i;
TCHAR *p = *c;
return -1;
}
-static uae_u32 returnregx(int regid)
+uae_u32 returnregx(int regid)
{
if (regid < BREAKPOINT_REG_PC)
return regs.regs[regid];
}
if (nc == '$') {
(*c)++;
- return readhexx (c, val) ? 1 : 0;
+ return readhexx (c, val) ? 1 : 0;
}
if (nc == '0' && _totupper ((*c)[1]) == 'X') {
(*c)+= 2;
- return readhexx (c, val) ? 1 : 0;
+ return readhexx (c, val) ? 1 : 0;
}
if (nc == '%') {
(*c)++;
case 'v':
case 'V':
{
- int v1 = vpos, v2 = 0, v3 = 0;
+ static int v1 = 0, v2 = 0, v3 = 0;
if (*inptr == 'h') {
inptr++;
if (more_params(&inptr) && *inptr == '?') {