Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
even i've tried looking for this answer. but haven't found a logical one yet. most websites bring this point and end it there.
but i guess AVR designers tried to sqeeze in more instructions that occupy 1 word
Even if you'll ever find the answer to this question, that would change your programming approach ?
Most of the AVR instruction have a single 16-bit word format.
As you probably notice, only 8 instructions suffers of the drawbacks of the AVR architecture.
These are : ANDI, CBR, SBR, SER, CPI, LDI, SBCI and SUBI.
More exactly when an immediate constant is involved in the operation with register.
Since the constant is stored on 8 bits (range 0 - 255) and 4 bits are reserved for operation code, from the 16-bit word format, there are only 4 bits left available for designed register.
Because with 4 bits you can have only 16 value, you can ask why the AVR designer choose the upper ones, r16-r31.
Well, the answer is because the r26-r31 are already used as indirect address pointers (alterable as well but in narrow range (0 - 63) with ADIW and SBIW).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.