[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Global variables and ISRs ???

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Global variables and ISRs ???
Date: Wed, 07 Sep 2005 12:16:20 +0200

> I guess, it's easier for the compiler to do things in a consistent way.

Yes I guess so too.. I didn't mean to complain about the looks of the
assembler output... after all if you use a compiler it's because you
don't want to write your own assembler to start with, so you can't
possibly complain of the compiler's assembler looks (as long as it works
of course) !! ;-)
I was only observing things... 

> >- everytime I test if a variable is zero or not, it AND's it with
> >itself... instead of just using the dedicated 'TST' instruction.
> "TST r" is an pseudo instruction and has the same opcode like an "AND
> r,r".

Ah that's interesting ! The description of the two operations is indeed
the same... I knew that assembler had pseudo instructions... I just
didn't know that the MCU itself could have pseudo instructions
built-in !! You live and learn :-)

Talking of instruction, I just noticed that there is a MUL instruction
in my ATmega32 but no DIV instruction ! How is that even possible...
even age old 8051 has a division instruction... so we can do quick
multiplications with the AVR, but need 50 times more cycles to do a
division ?? I hope I am missing something, because I am finding it very
inconsistent, and extremely disappointing from this otherwise super
modern and performant MCU...
In the long term, I was toying with the idea of playing a bit with fuzzy
logic and 'Z' filters in control applications, but I guess that will
require intensive maths, so if I can't even do divisions in hardware...
I better forget it I guess... until Atmel makes a new AVR with a super
duper MDU built-in...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]