HLA编译错误

时间:2017-10-20 19:25:20

标签: assembly x86 hla

无法理解有什么不对。谢谢你的帮助

program first;

#include("stdlib.hhf");

static
    x: int16;
    y: int16;
    result1: int16;
    input: char;
    isEnd: char := 'n';

begin first;

    stdout.put("x = "); stdin.get(x);
    stdout.put("y = "); stdin.get(y);
    stdout.put("operation: "); stdin.get(input);

    while (isEnd == 'y') do

        if(input == '+') then
            mov(x, result1);
            mov(y, AX);
            add(AX, result1);
        elseif(input == '-') then
            mov(x, result1);
            mov(y, AX);
            sub(AX, result1);
        elseif(input == '*') then
            mov(x, result1);
            mov(y, AX);
            mul(AX, result1);
        elseif(input == '/') then

            if(y == 0) then
                stdout.put("y cannot be 0, setting result1 to 0", nl);
                mov(0, result1);
            endif;

            mov(x, AX);
            mov(y, result1);
            div(AX, result1);
        endif;

        stdout.put("result1 = ", result1, nl);

    endwhile;

end first;

我正在使用hla 2.16 build 443(原型) 文件错误" first.hla"在第31行[errid:129712 / hlaparse.c]: 语法错误,意外')',期待'('。

0 个答案:

没有答案