|
From: | Dave N6NZ |
Subject: | Re: [avr-gcc-list] accessing carry bit |
Date: | Wed, 30 Jan 2008 10:11:15 -0800 |
User-agent: | Thunderbird 1.5 (X11/20051201) |
John Regehr wrote:
microcontroller compilers support - the ability to write things like "if (CARRY) ..." can be a big win for some code.A killer app for exposing some of the condition code flags to C may be that this facilitates very efficient integer over/under flow detection. Integer overflows are the source of many nasty security holes.
I missed the earlier comments on this, but isn't getting to the condition codes a simple library of inline asm functions? Am I over-simplifying?
Of course, there are plenty of ways that could screw up optimization (unless optimization is oblivious, in which case optimizer code motion destroys the flag you are after.)
-dave
[Prev in Thread] | Current Thread | [Next in Thread] |