Ivo-Balbaert / The_Way_to_Jai

A gradual guide to discover and learn the Jai programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

exercise 28, asm1.jai gives an error

LongBoolean opened this issue · comments

I don't know much about asm, I stumbled on this while trying to learn a little.

The_Way_to_Jai/exercises/28/asm1.jai:20,13: Info: This variable cannot be used as a register operand, because its address gets taken, which means it also has storage on the stack. (There can be subtle reasons why the address gets taken, for example, if you pass it to print(), it gets cast to Any, which takes the address.)

    // result = a1
    mov result, a1;


Running linker:

It compiles, but printing result yields the value 0.

Oddly, creating a new variable result2 and assigning it the value ofresult gives the correct result of 55. I'm confused as to what is going on here.