Search code examples
assemblyhla

Adding Variables in HLA?


So, I'm trying to add variables, but it doesn't want to work. I have a really simple program.

program tested;

var
    i: int8;
    x: int8;


begin tested;
    mov(10, i);
    mov(5, x);
    add(i, x);
    stdout.put(x);

end tested;

I get the following error: "Error in file 'tested.hla' at line 11 [errid:129712/hlaparse.c]: syntax error, unexpected ')', expecting '('. Near: << ) >>"

Mov is supposed to move the number into the variable..and add is supposed to add two things. Why isn't it working?

I don't really understand hla so any help would be most appreciated.


Solution

  • Note that 5 and 10 are "constants" and you cannot change the values of 5 or 10. Remember mov(dest, source); for example: mov(x,i); copy the value of i and put it in the address of x