Hello SDCC users,

I am sure this has been discussed before. So I apologize in advance for
repeating it.

With assembler, you can test for a reg/mem operation over/under flow by
checking the carry flag.

So for C, when overflows are involved, I have always used larger
variables. For 8 bit, use 16 bit. For 16, use 32. Then greater/less
than tests can be used looking for quasi over flow. But that's
wasteful.

How do you check over/underflow in C without wasting memory?

/Mike
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to