DCPUTeam / DCPUToolchain

[ARCHIVED] The code repository for the DCPU-16 Toolchain.
http://dcputoolcha.in/
MIT License
96 stars 14 forks source link

Expression as pointer #95

Closed mamartel closed 12 years ago

mamartel commented 12 years ago

There's a bug where if you put an expression as an "on the fly" pointer, it's not working. Example :

void main()
{
    char addr = 0x8000;
    *(addr + 1) = 0x32 + 0xC000;
    // or 
    *(0x8000 + 1) = 0x32 + 0xC000;
}

Should print "2" at the second poisition on the screen, but nothing is shown. On the other hand, if you write

void main()
{
    char addr = 0x8001;
    *(addr) = 0x32 + 0xC000;
    // or 
    *(0x8001) = 0x32 + 0xC000;
}

It's working, or

void main()
{
    char addr = 0x8000;
    addr++;
    *(addr) = 0x32 + 0xC000;
}

is working too.

patflick commented 12 years ago

fixed