Thank you Alex,
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? Can I say that the need is restricted to the use of BigNum?

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?

Regards,
Kashyap


On Tue, Mar 29, 2022 at 12:31 PM Tomas Hlavaty <t...@logand.com> wrote:

> On Tue 29 Mar 2022 at 18:49, Alexander Burger <a...@software-lab.de> wrote:
> > As C does not allow access to the carry bit, you have to do ugly and
> inefficient
> > tricks, by looking at the most significant bit of the result and trying
> to
> > detect an overflow. For example, in bigAdd() in pil32's src/big.c:
> >
> >    carry = (unDig(src) & ~1) > num(setDig(dst, (unDig(src) & ~1) +
> (unDig(dst) & ~1)));
> [...]
> > Concerning the stack, assembly code can handle the hardware stack
> pointer just
> > like any other register.
>
> interesting
>
> Did you consider GCC inline assembly?
> What were the reasons you did not use it?
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to