Hi Jakob,

> change to a cross compiler in the makefile. However, -falign-functions
> did not exist in that version of GCC. And sure enough, while it built,
> it would not run, dying on the assertion "giveup("Unaligned Function");".
> 
> Any ideas? Why does alignment matter?

Function pointers are represented as numbers. miniPicoLisp supports only
short numbers, and they need to be encoded in the form xxxxxx10 (see in
"mini/doc/structures"). That is, bit 0 must be zero, and bit 1 must be
one. This is accomplished in miniPicoLisp by aligning the functions to a
multiple of 4 (giving xxxxxx00) and then 'or'ing with 2.

pil32 doesn't have that problem, because all numbers are bignums where
the function pointer can be directly stored in the cell.

In pil64 is even easier, because the assembler has a better control over
the alignment and can put functions directly at addresses of the form
xxxxxx10, needing no runtime bit manipulations at all.


> Also - I find the general idea of using picolisp as an embedded control
> language inside other applications interesting, not just this special
> platform.

So it would be nice to get pil32 or pil64 running.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to