[chbot] Anyone seen this error ? avrdude: verification error, first mismatch at byte 0x3c000 on atmega2560

Paul Davey plmdvy at gmail.com
Fri Apr 24 18:46:45 BST 2020


On Fri, Apr 24, 2020 at 7:50 PM Peter Ellens <ellensp at gmail.com> wrote:

> On 4/24/20 5:25 PM, Volker Kuhlmann wrote:
>
> On Tue 21 Apr 2020 14:20:39 NZST +1200, Peter Ellens wrote:
>
>
> I of course used good old never fails BODMAS...  (until C! )
>
> BODMAS? Is that edible?!???
>
>
> Addition (0x3FFFF - 0x4000 +1) becomes (0x3FFFF - 0x4001)
>
> Uhhmm... no.
>
>
> But C doesn't do this...
>
> Maybe there's a very good reason it doesn't... Operator precedence in C
> can be dicey in places, but not regarding addition or substraction.
>
> Back when I was at school and C was a letter not a language,
> (0x3FFFF - 0x4000 + 1) was ((0x3FFFF - 0x4000) + 1),
> or ((0x3FFFF + 1) - 0x4000), but most
> definitely not (0x3FFFF - (0x4000 + 1)). Addition is commutative,
> subtraction is not.
>
> Or, if you want, (+0x3FFFF + -0x4000 + +1) in any order of evaluation.
>
> If you're referring to the "+" in "0x4000 +1" being a sign and not an
> operator, the expression no longer has an operator. That's a no-go.
> Mathematical notation allows to leave off an operator, then it becomes
> multiplication. No programming language I've had contact with, including
> C, have ever allowed that.
>
> Are you blaming C, when your math is... in a bubble of one? ;-)
>
> Unless some virus has turned my brain to mush, in which case you can all
> have a laugh at my expense.
>
> Volker
>
>
> Apparently I'm going senile...  luckily it doesn't effect the original
> bug, just the exact address point it starts to happen.
>
> From the internet:
> How Do I Remember It All ... ? BODMAS !
> *B*
> *B*rackets first
>
> *O*
> *O*rders (i.e. Powers and Square Roots, etc.)
>
> *DM*
> *D*ivision and *M*ultiplication (left-to-right)
>
> *AS*
> *A*ddition and *S*ubtraction (left-to-right)
>
> This is not how I remembered it.
>
> I incorrectly remembered it as  Addition then Subtraction.
>
> Senility sucks...
>
>
Yes Addition and Subtraction are always equal precedence as subtraction is
just a shortcut for addition with a negation in the second argument, as
long as you do this transformation into negation it doesnt matter what
order you actually perform the additions in.

 People on facebook really enjoy arguing endlessly over the vagaries of
infix mathametical notation and which things should happen before other
things.  Perhaps those arguments would be more easily put to rest if
everyone just used reverse polish notation...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20200425/dde7d9b4/attachment.html>


More information about the Chchrobotics mailing list