Fuzix-Compiler-Kit icon indicating copy to clipboard operation
Fuzix-Compiler-Kit copied to clipboard

op16_on_node() in be-code-6800.c does not set array addresses correctly.

Open zu2 opened this issue 4 months ago • 1 comments

Problems encountered in test/tests/0601-register.c test on MC6800 CPU.

int test_cast(void)
{       
    static int buf;
    register char *p = (char *)&buf;
    *(int *)p = 0x1234;
    return buf;
}

When this function is compiled, the following object is generated.

_test_cast:
        des
        des
        ldaa #<T6+0
        ldab #<T6+1

This should be the upper and lower bytes of #T6.

_test_cast:
        des
        des
        ldaa #T6/256
        ldab #T6%256

This problem occurs at op16_on_node() in be-code-6800.c , but I can't think of any ideas to fix it.

zu2 avatar Oct 07 '24 10:10 zu2