Index: src/monitor/mon_parse.y =================================================================== --- src/monitor/mon_parse.y (revision 44572) +++ src/monitor/mon_parse.y (working copy) @@ -796,7 +796,7 @@ $$ = new_cond; $$->is_parenthized = FALSE; $$->child1 = $1; $$->child2 = $3; $$->operation = $2; } - | cond_expr COND_OP error + | cond_expr COND_OP error { return ERR_INCOMPLETE_COND_OP; } | L_PAREN cond_expr R_PAREN { $$ = $2; $$->is_parenthized = TRUE; } @@ -818,16 +818,32 @@ $$->value = $1; $$->is_reg = FALSE; $$->banknum=-1; $$->child1 = NULL; $$->child2 = NULL; } - | '@' BANKNAME ':' address {$$=new_cond; - $$->operation=e_INV; + /* Example: break load 0 $ffff if @cpu:(pc) < $80 */ + | '@' BANKNAME ':' L_PAREN cond_expr R_PAREN { + $$ = new_cond; + $$->operation = e_INV; $$->is_parenthized = FALSE; $$->banknum = mon_banknum_from_bank(e_default_space, $2); if ($$->banknum < 0) { return ERR_ILLEGAL_INPUT; } - $$->value = $4; $$->is_reg = FALSE; + $$->value = 0; + $$->is_reg = FALSE; + $$->child1 = $5; + $$->child2 = NULL; + } + | '@' BANKNAME ':' address { + $$ = new_cond; + $$->operation = e_INV; + $$->is_parenthized = FALSE; + $$->banknum = mon_banknum_from_bank(e_default_space, $2); + if ($$->banknum < 0) { + return ERR_ILLEGAL_INPUT; + } + $$->value = $4; + $$->is_reg = FALSE; $$->child1 = NULL; $$->child2 = NULL; - } + } ; data_list: data_list opt_sep data_element Index: src/monitor/monitor.c =================================================================== --- src/monitor/monitor.c (revision 44572) +++ src/monitor/monitor.c (working copy) @@ -2592,9 +2592,16 @@ mon_out("%s", register_string[reg_regid(cnode->reg_num)]); } else if (cnode->banknum >= 0) { - mon_out("@:%s:$%04x", - mon_get_bank_name_for_bank(default_memspace,cnode->banknum), - (unsigned int)cnode->value); + if (cnode->child1) { + mon_out("@%s:(", + mon_get_bank_name_for_bank(default_memspace,cnode->banknum)); + mon_print_conditional(cnode->child1); + mon_out(")"); + } else { + mon_out("@%s:$%04x", + mon_get_bank_name_for_bank(default_memspace,cnode->banknum), + (unsigned int)cnode->value); + } } else { mon_out("$%02x", (unsigned int)cnode->value); } @@ -2688,7 +2695,12 @@ reg_regid(cnode->reg_num)); } else if(cnode->banknum >= 0) { MEMSPACE src_mem = e_comp_space; - uint16_t start = addr_location(cnode->value); + uint16_t start; + if (cnode->child1 != NULL) { + start = mon_evaluate_conditional(cnode->child1); + } else { + start = addr_location(cnode->value); + } uint8_t byte1; int old_sidefx = sidefx; /*we need to store current value*/ sidefx = 0; /*make sure we peek when doing the break point, otherwise weird stuff will happen*/