Hi Kashyap,

> I can see how you would have to end up writing the whole thing in assembly
> - in the example you shared. Would it be right to say that its only the
> carry flag that you need or is it just an example and there are other flags
> too?

Pil64 used three flags (zero, sign and carry). CPUs usually have a lot more
of them, e.g. overflow, but I decided to go without them.

Some functions returned values in one or more registers, plus some flags. This
is much more powerful than the single return value supported by C.

> Can I say that the need is restricted to the use of BigNum?

On the machine instruction level, the carry is used in a lot more situations,
like comparisons or arithmetic shifts.


> The ability to set/get the stack I presume needs to be compared with
> setjmp/longjmp - correct? Is setjmp/longjmp insufficient or is it not
> efficient enough?

No, setjmp/longjmp is fine. Pil21 uses it too. But in some situations you need
to set the stack pointer explicitly (e.g. when allocating coroutine stack areas)
or read it (stack overflow checks).

☺/ A!ex

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

Reply via email to