private void I_ALI(string cmd)
{
skip_space();
int dest_r = R();
skip_space();
if (cur_token != ',')
error("指令不完整,期望逗号(,)");
get_src_token();
skip_space();
int src_r = R();
skip_space();
if (cur_token != ',')
error("指令不完整,期望逗号(,)");
get_src_token();
skip_space();
string word;
//首先假设指令第三个参数是立即数,如果尝试读取立即数失败,
//再尝试读取标记
try
{
word = get_number_word();//读取数字
int imm = parse_number_16(word);
#if debug
Debug(String.Format("got imm num {0}", imm));
#endif
format_line.AppendFormat("R{0}, R{1}, {2}", dest_r, src_r, word);
}
catch (DLXException)
{
delete_last_error();//删除上面try中产生的错误
word = get_word();//读取标记
#if debug
Debug("got imm label:" + word);
#endif
format_line.AppendFormat("R{0}, R{1}, {2}", dest_r, src_r, word.ToUpper ());
int index = 0;
skip_space();
if (cur_token == '[')
{
get_src_token();
skip_space();
string n_w = get_number_word();
index = parse_number_16(n_w);
#if debug
Debug("got array num: " + index.ToString());
#endif
skip_space();
if (cur_token != ']')
error("错误的语法,期望']'");
get_src_token();
format_line.AppendFormat("[{0}]", n_w);
}
if (check_symbol(word.ToUpper(), index) == false)
add_to_wait(word.ToUpper(), line, line_at);
}
catch
#if debug
(Exception e)
#endif
{
#if debug
Debug(e.StackTrace.ToString());
#endif
}
}