Ponde scc32plus specific

New keywords

- byteptr, hwordptr, wordptr
- as, const, sizeof
- __map__(var)

Accessing External memory

- word access (32-bit)
- half word access (16-bit)
- byte access (8-bit)

    word memptr;       // global variable

    word x;

    memptr = MEM_ADDR;
    x = *wordptr++;    // pointer is post-incremented

    *hwordptr++ = hword(x);
    *hwordptr++ = hword(rot16(x));

    x = 0;
    repeat(4) {
      x = rol8(x);
      x |= *byteptr++;

Accessing External memory using CONST reg

- SCC32_EXCONST must be set in configuration
- CONST register is used when r15 is set in the mapping register
- upper 16-bit is set in the configuration (SCC32_EXCBASE)
- 64KB starting from SCC32_EXCBASE in 4GB
- CONST register will be updated if post-modifier is set

  #error  EXCONST mode not set

    word x;

    x = *(const=0x1000 as wordptr++);
    x += *(const as wordptr++);
    x += *wordptr++;                   // CONST as wordptr


- returns the size of the object being accessed

    sizeof(*wordptr)  --- value: 4
    sizeof(*hwordptr) --- value: 2
    sizeof(*byteptr)  --- value: 1

Iteration support

You can map a local (auto) variable to a virtual iteration variable, itervar, using __iter__(var).
The mapped variable can be referred using itervar and optional modifier (++ or --) can be specified.

    void func()
        word loop;

        loop = 4;
        while(itervar--) {
            /** do something **/
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License