--- In AVR-Chat@yahoogroups.com, "Gmail" <moatazhussein@...> wrote: > I want to branch at a certain part of the program when a > register (Temp) value is greater than or equal to $FA. I doubt that BRMI is the instruction you should be using. It would more commonly be used when the operands are signed values. Instead, look at BRSH (branch if same or higher). It works just as well following a subtract instruction as it does following a compare instructions. After all, a compare is just a subtract that doesn't save the result. Note, particularly, that BRSH is used for unsigned values while BRGE is used for signed values. > It is not working as understood, i see other flags are > also affected. there is something that i do not see!! You need to consult the "AVR Instruction Set" document available from the Atmel site. For SUBI, it indicates that all status flags except I and T may be modified. Here is a link to the instruction set document: http://www.atmel.com/dyn/resources/prod_documents/doc0856.pdf Don Kinzer ZBasic Microcontrollers http://www.zbasic.net
Message
Re: Branchging intsruction-- BRMI
2009-05-21 by Don Kinzer
Attachments
- No local attachments were found for this message.